ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pass multiple parameters through macros (https://www.excelbanter.com/excel-programming/299284-pass-multiple-parameters-through-macros.html)

Chris Perry[_2_]

Pass multiple parameters through macros
 
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.


Harald Staff

Pass multiple parameters through macros
 
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


"Chris Perry" skrev i melding
...
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.





All times are GMT +1. The time now is 10:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com