Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Exclamation Macro to C&P from all Sheets

I need a Macro to select the same specific cells on every sheet in a workbook and fill in the first master tab to with the info. Basicaly each tab is an employee, and it will have there total wage, so the specific cells will copy the name (B2) and the total wage(G23).

The other issue is there is about 100 tabs, and they are constantly changing, adding and deleting, so the macro needs to adapt to new sheets?

Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 829
Default Macro to C&P from all Sheets

"Robert Farrand" wrote:
I need a Macro to select the same specific cells on every
sheet in a workbook and fill in the first master tab to
with the info. Basicaly each tab is an employee, and it
will have there total wage, so the specific cells will
copy the name (B2) and the total wage(G23).
The other issue is there is about 100 tabs, and they are
constantly changing, adding and deleting, so the macro
needs to adapt to new sheets?


If the "master tab" is always the first worksheet and all of the remaining
worksheets are to be copied, perhaps the following get you started.

Dim mastRng As Range
Dim i As Long, n As Long
' copy into A2:B2, A3:B3, etc
Set mastRng = Sheets(1).Range("A2")
For i = 2 to Sheets.Count
mastRng.Offset(i-2,0) = Sheets(i).Range("B2")
mastRng.Offset(i-2,1) = Sheets(i).Range("G23")
Next

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
Run macro on all sheets trey1982 Excel Worksheet Functions 3 April 7th 09 03:07 AM
macro for same value in 2 different sheets sharmashanu Excel Discussion (Misc queries) 1 March 15th 07 03:26 AM
How to run a macro on all sheets? Todd Excel Programming 1 April 18th 06 08:18 PM
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets Punsterr Excel Programming 3 February 21st 06 04:01 AM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork[_3_] Excel Programming 6 January 26th 06 06:31 PM


All times are GMT +1. The time now is 04:02 AM.

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"