In this example, we will use Abs() math function of Visual Basic 6 to find absolute value of a number.
Program Code: Abs( ) Function
Private Sub Command1_Click()
Dim Absolute As Integer
Absolute = Abs(Val(Text1.Text))
MsgBox ("The Absolute value is" & " " & Absolute)
End Sub