ABS Function

     

  • It returns absolute value
  •  

    Private Sub CommandButton1_Click()
    'returns absolute value
    Range("B1").Value = Abs(Range("A1"))
    Range("B2").Value = Abs(Range("A2"))
    Range("B3").Value = Abs(Range("A3"))
    Range("B4").Value = Abs(Range("A4"))
    Range("B5").Value = Abs(Range("A5"))
    Range("B6").Value = Abs(Range("A6"))
    End Sub

     

  • It returns the ABSOLUTE value of the number
  •  

     

    Private Sub CommandButton1_Click()
    Dim max As Integer
    max = Range(Range("A1"), Range("A1").End(xlDown)).Rows.Count
    Dim i As Integer
    For i = 1 To max
    'find "a" postion in specified string
    Cells(i, 2) = Abs(Cells(i, 1))
    Next
    End Sub

     

     

    ASC Function

     

  • ASCII: American Standard Code For Information Interchange
  • Values range between 0 To 255
  • In case of letter number returns based on first letter of string
  •  

    Private Sub CommandButton1_Click()
    Range("B1").Value = Asc(Range("A1"))
    Range("B2").Value = Asc(Range("A2"))
    'gives the first character
    Range("B3").Value = Asc(Range("A3"))
    End Sub

     

     

    Chr Function

     

  • It converts Number into Character
  •  

    Private Sub CommandButton1_Click()
    Range("B1").Value = Chr(Range("A1"))
    MsgBox Chr(Range("A1"))
    End Sub

     

     

    Int Function

     

  • Returns Integer value
  • Private Sub CommandButton1_Click()
    Range("B1").Value = Int(Range("A1"))
    Range("B2").Value = Int(Range("A2"))
    End Sub

     

     

     

    SQR Function

     

  • It returns sqare root value of given number
  •  

    Private Sub CommandButton1_Click()
    Range("B1").Value = Sqr(Range("A1"))
    End Sub

     

     

     

     

    Format Function

     

  • It denots about the format of number
  • # represents one DIGIT PLACE
  •  

    Private Sub CommandButton1_Click()
    MsgBox Format(Range("A1"), "#,###.#")
    Range("B1") = Format(Range("A1"), "#,###.##")
    End Sub

     

     

     

    Large Function

     

  • To retrieve LARGE values
  •  

    Private Sub CommandButton1_Click()
    Dim num As Integer
    Max = Range("C2").End(xlDown).Row
    Data = Range("C2:C" & Max)
    For i = 1 To 5
    J = Application.WorksheetFunction.Large(Data, i)
    Cells(i, 5).Value = J
    Next
    End Sub