Multiple Query in once button in same sheet

Closed
Raju - Jun 24, 2016 at 02:38 PM
vcoolio Posts 1409 Registration date Thursday July 24, 2014 Status Moderator Last seen May 23, 2024 - 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?



Related:

1 response

vcoolio Posts 1409 Registration date Thursday July 24, 2014 Status Moderator Last seen May 23, 2024 262
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.