PC Review


Reply
Thread Tools Rate Thread

Re: Macro to C&P from all Sheets

 
 
joeu2004
Guest
Posts: n/a
 
      15th Aug 2012
"Robert Farrand" <(E-Mail Removed)> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
from "all sheets except" to "all sheets after" J.W. Aldridge Microsoft Excel Programming 3 20th Apr 2009 05:26 PM
Print sheets by "All Sheets in workbook, EXCEPT for specific named sheets". Possible? Corey Microsoft Excel Programming 2 11th Dec 2006 02:35 AM
Macro for filter on protected workbook that works for all sheets, no matter what sheets are named? StargateFanFromWork Microsoft Excel Programming 6 26th Jan 2006 07:31 PM
Microsoft Speech Recognition repeating error "all all all all all all...." kenrosen@gmail.com Windows XP General 1 17th Dec 2005 03:22 AM
Microsoft Speech Recognition repeating error "all all all all all all...." kenrosen@gmail.com Windows XP Help 0 16th Dec 2005 07:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:26 PM.