![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Canberra AU
Posts: 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 |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
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 |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Location: Canberra AU
Posts: 7
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|