LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Gary''s Student
 
Posts: n/a
Default Applying same macro to all worksheets in workbook

This macro moves through each worksheet in a workbook and sums the first cell:

Sub Macro1()
Dim w As Worksheet
t = 0
For Each w In Worksheets
w.Activate
t = t + Cells(1, 1)
Next
MsgBox (t)
End Sub

Adapt it to your needs
--
Gary's Student


" wrote:

HI,

I am trying to find an easy way to apply a macro that changes the
absolute value of a couple of cells and changes some plot formatting to
all sheets in a workbook. All sheets are the same and need the same
macro applied to them, I have recorded the macro such that I can click
on a worksheet and hit a keyboard command to execute this, but I have
to individually select each worksheet and repeat this throughout, how
can this be automated?

Thanks,

Josh


 
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
Protecting all worksheets of a workbook neeraj Excel Discussion (Misc queries) 14 May 30th 06 09:46 PM
workbook Protection Toggle Macro Just Learning Excel Discussion (Misc queries) 3 August 30th 05 11:03 PM
How do I build a workbook from the worksheets another workbook? Rico Excel Discussion (Misc queries) 4 August 19th 05 02:04 PM
how do I arrange multiple worksheets from the same workbook skytags Excel Discussion (Misc queries) 2 April 28th 05 06:46 PM
Extract specific data into its own workbook via macro? Adrian B Excel Discussion (Misc queries) 2 February 24th 05 06:09 AM


All times are GMT +1. The time now is 05:52 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"