Variables

  • Thread starter Thread starter Guest
  • Start date Start date
Pass the variable to the other procedure.

Example:
Function AddEmUp(a as Long, b as long) As Long
AddEmUp = a + b
End Function

Now pass the variables like this:
Sub cmdGetAnswer_Click()
Dim a as Long
Dim b As Long
Dim c As Long
a = 4
b = 5
c = AddEmUp(a, b)
End Sub
 
Thanks Allen..fantastic.

Allen Browne said:
Pass the variable to the other procedure.

Example:
Function AddEmUp(a as Long, b as long) As Long
AddEmUp = a + b
End Function

Now pass the variables like this:
Sub cmdGetAnswer_Click()
Dim a as Long
Dim b As Long
Dim c As Long
a = 4
b = 5
c = AddEmUp(a, b)
End Sub
 
Back
Top