Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to automate a macro to run on all sheets in a workbook
Hello,
I know that this is probably really simple, but I am trying the run a macro on all sheets in a workbook, there are 60 sheets all of the same format and structure, however i have to rearrange the structure, so I was hoping that I can record a macro and then add some code so it will run on all sheets? Any help would be appreciated Thanks Maurice |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to automate a macro to run on all sheets in a workbook
Maurice,
Try structuring your code as the following: Dim WS As Worksheet For Each WS In Worksheets ' do something with WS Next WS -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Maurice Roche" wrote in message ... Hello, I know that this is probably really simple, but I am trying the run a macro on all sheets in a workbook, there are 60 sheets all of the same format and structure, however i have to rearrange the structure, so I was hoping that I can record a macro and then add some code so it will run on all sheets? Any help would be appreciated Thanks Maurice |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to automate a macro to run on all sheets in a workbook
Dim sh as Worksheet
for each sh in ActiveWorkbook.worksheets sh.Activate Next -- Regards, Tom Ogilvy "Maurice Roche" wrote in message ... Hello, I know that this is probably really simple, but I am trying the run a macro on all sheets in a workbook, there are 60 sheets all of the same format and structure, however i have to rearrange the structure, so I was hoping that I can record a macro and then add some code so it will run on all sheets? Any help would be appreciated Thanks Maurice |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Copy Sheets to new workbook | Excel Discussion (Misc queries) | |||
Need macro to consolidate all sheets in workbook | Excel Discussion (Misc queries) | |||
Macro to create new workbook and sheets | Excel Discussion (Misc queries) | |||
Use Macro to protect choosen sheets in workbook | Excel Discussion (Misc queries) | |||
Macro to link Sheets to main workbook | Excel Discussion (Misc queries) |