Multiple Query in once button in same sheet

Closed
Raju - Jun 24, 2016 at 02:38 PM
vcoolio
Posts
1353
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
August 10, 2022
- Jun 25, 2016 at 04:00 AM
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

vcoolio
Posts
1353
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
August 10, 2022
250
Jun 25, 2016 at 04:00 AM
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.
0