Multiple Query in once button in same sheet [Closed]

Report
-
Posts
1292
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
May 7, 2021
-
Hello all,

I have created two separate queries in excel VBA. I have given two different buttons for both queries and both are running successfully.

I want to execute both queries in once button. Could anybody hep me on this?



1 reply

Posts
1292
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
May 7, 2021
230
Hello Raju,

By queries I assume that you mean macros. If so, you can have your main macro call the other one just by placing the name of the second macro (without the parentheses) just above End Sub in the main macro.

For example:-

Sub MainMacro()
'your code here

'Second Macro Name here ---->No parentheses needed.
End Sub


I hope that this helps.

Cheerio,
vcoolio.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!