Smurfit-Stone
Active Member
- Joined
- Dec 1, 2004
- Messages
- 485
Hello Board,
I have a macro that I want to use on two separate (but identical) files. One is for ordering Cutting Dies and the other for Print Plates. These two file have different file names. The macro is assigned to a icon on my toolbar. It works perfectly, but whenever I click my icon to run the macro it opens the other file. Its like the macro can only be connected or linked to one file at a time. I tried to make the macro non specific by using "active worksheet", but something is not working properly. Can anyone tell me how I can have two files with different name and with the same macro in both...share a single icon on my toolbar? The macro is as follows
Sub SheetsVisible()
Dim wks As Worksheet
Sheets("Order").Activate
For Each wks In ActiveWorkbook.Worksheets
wks.Visible = True
Next wks
End Sub
Thanks in advance.
I have a macro that I want to use on two separate (but identical) files. One is for ordering Cutting Dies and the other for Print Plates. These two file have different file names. The macro is assigned to a icon on my toolbar. It works perfectly, but whenever I click my icon to run the macro it opens the other file. Its like the macro can only be connected or linked to one file at a time. I tried to make the macro non specific by using "active worksheet", but something is not working properly. Can anyone tell me how I can have two files with different name and with the same macro in both...share a single icon on my toolbar? The macro is as follows
Sub SheetsVisible()
Dim wks As Worksheet
Sheets("Order").Activate
For Each wks In ActiveWorkbook.Worksheets
wks.Visible = True
Next wks
End Sub
Thanks in advance.