Pass multiple parameters through macros

C

Chris Perry

I want to pass more than one parameter through a
procedure. Ex.
Sub AAAAquery()
Dim queryname
Dim querynumber
Dim testname


Sub BBBBquery()

AAAAquery (queryname)

I can pass the defined variable queryname through. I want
to add testname. Ex.
Sub BBBBquery()

AAAAquery (queryname, testname)
This does not work.
 
H

Harald Staff

Hi

Sub Main()
Call PassedToMe("Yo", 42, DateSerial(1944, 12, 5))
End Sub

Sub PassedToMe(S As String, L As Long, D As Date)
MsgBox "You said " & S & Chr(10) & _
"and the lucky number is " & L & Chr(10) & _
"and you were born " & D
End Sub

HTH. Best wishes Harald
 
Top