Running Multipule macros (Same name different sheet)

Staticman

New Member
Joined
Mar 15, 2002
Messages
7
Hi all,
I'm new to the macro world and need a little help.
I have a macro that is based on the sheet name and retreives data from different sources depending on that name, the macro is called Get_Data.
I have about 10 sheets at the moment that use the same macro (Get_Data is a Template)
what i would like to do is have all the Get_Data macros run when the workbook opens.
Is there a way to have this happen without naming the macros ie: Get_Data1, get_Data2...etc and run from the workbook when its opened ?

Much Appreciated
Static
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi Staticman

I am not sure what you mean by "Is there a way to have this happen without naming the macros ie: Get_Data1, get_Data2...etc" But to have a Macro run upon opening you should place some code in the Private Module of the Workbook Object. To get there just right click on the Excel icon, next to "File" and select "View Code" then paste in this:

Private Sub Workbook_Open()
Run "Get_Data"
End Sub
 
Upvote 0
Thanks Dave
The Get_Data macro is on every sheet.
I found that I need to change to the sheet then run the macro again.
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top