Novice at VBA so bear with me.
Am trying to convert the number in a variable to another number and have to do this quite often so wrote a Function to do the calculation and return the result to the same variable.
Dim intInteger as Integer
Sub MainSub()
intInteger = 2
Convert (intInteger)
End Sub
Function Convert(ByVal number as Integer) as Integer
number = number * 4
End Function
How do I get the 'number' (2*4) 8 back into the MainSub and put it in the original intInteger or another variable?
Thanks, Numbers
Am trying to convert the number in a variable to another number and have to do this quite often so wrote a Function to do the calculation and return the result to the same variable.
Dim intInteger as Integer
Sub MainSub()
intInteger = 2
Convert (intInteger)
End Sub
Function Convert(ByVal number as Integer) as Integer
number = number * 4
End Function
How do I get the 'number' (2*4) 8 back into the MainSub and put it in the original intInteger or another variable?
Thanks, Numbers