Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run macro on all sheets | Excel Worksheet Functions | |||
macro for same value in 2 different sheets | Excel Discussion (Misc queries) | |||
How to run a macro on all sheets? | Excel Programming | |||
"With Sheets" Issue - macro on one sheet to affect hidden rows on other sheets | Excel Programming | |||
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? | Excel Programming |