Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a work book with 4 sheets...while each sheet receives updated data
regularly...the fields in each sheet are identical. Is there a way to run a workbook macro on all sheets at once ? I can only figure out how to run the macro on each sheet separately "? Thanks, Tim R |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can't really run a macro on all sheets "all at once" (whatever that
might mean), but you can certainly write code that will run for each sheet sequentially: Sub AAA() Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets ' do something with the WS worksheet Next WS End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "Tim" wrote in message ... I have a work book with 4 sheets...while each sheet receives updated data regularly...the fields in each sheet are identical. Is there a way to run a workbook macro on all sheets at once ? I can only figure out how to run the macro on each sheet separately "? Thanks, Tim R |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You can loop through the sheets using one macro.
Dim wkbktodo As Workbook Dim ws As Worksheet Set wkbktodo = ActiveWorkbook For Each ws In wkbktodo.Worksheets 'do your stuff Next ws Gord Dibben MS Excel MVP On Sun, 4 Nov 2007 15:05:12 -0700, "Tim" wrote: I have a work book with 4 sheets...while each sheet receives updated data regularly...the fields in each sheet are identical. Is there a way to run a workbook macro on all sheets at once ? I can only figure out how to run the macro on each sheet separately "? Thanks, Tim R |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2003 and Macros | Excel Discussion (Misc queries) | |||
Excel 2003 macros | Excel Discussion (Misc queries) | |||
event macros - xl 2003 | Excel Worksheet Functions | |||
Macros in 2003 | Excel Discussion (Misc queries) | |||
excel 2003 - macros & buttons | New Users to Excel |