#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default 2003 macros

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default 2003 macros

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 2003 macros

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 and Macros Kevin Murphy Excel Discussion (Misc queries) 0 June 21st 06 09:16 PM
Excel 2003 macros pspeed Excel Discussion (Misc queries) 4 December 15th 05 12:54 AM
event macros - xl 2003 Sue Excel Worksheet Functions 8 November 7th 05 07:46 AM
Macros in 2003 Mohd Anis Excel Discussion (Misc queries) 2 September 26th 05 12:04 PM
excel 2003 - macros & buttons mikey New Users to Excel 2 May 19th 05 11:51 AM


All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"