PC Review


Reply
Thread Tools Rate Thread

Copy data in multiple worksheet tabs into one worksheet

 
 
Bob
Guest
Posts: n/a
 
      15th Feb 2008
I have data in various tabs (some tabs have one row of data, others have
more) that I would like to move or copy into one worksheet. I would like to
use code to do this as some workbooks can have as much as 40 tabs while
others could have 10 tabs.
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      15th Feb 2008
Sub make_summary()

Worksheets.Add before:=ThisWorkbook.Sheets(1)
Set SumSht = ActiveSheet
SumSht.Name = "Summary"

For Each sht In ThisWorkbook.Sheets
If sht.Name <> "Summary" Then
SumLastRow = SumSht.Range("A" & Rows.Count).End(xlUp).Row
ShtLastRow = sht.Range("A" & Rows.Count).End(xlUp).Row
sht.Rows("1:" & ShtLastRow).Copy _
Destination:=SumSht.Rows(SumLastRow + 2)
End If
Next sht

End Sub

"Bob" wrote:

> I have data in various tabs (some tabs have one row of data, others have
> more) that I would like to move or copy into one worksheet. I would like to
> use code to do this as some workbooks can have as much as 40 tabs while
> others could have 10 tabs.

 
Reply With Quote
 
Bob
Guest
Posts: n/a
 
      15th Feb 2008
This removes row 1 from all the worksheets and does not copy or move anything
to the "Summary" page.

"Joel" wrote:

> Sub make_summary()
>
> Worksheets.Add before:=ThisWorkbook.Sheets(1)
> Set SumSht = ActiveSheet
> SumSht.Name = "Summary"
>
> For Each sht In ThisWorkbook.Sheets
> If sht.Name <> "Summary" Then
> SumLastRow = SumSht.Range("A" & Rows.Count).End(xlUp).Row
> ShtLastRow = sht.Range("A" & Rows.Count).End(xlUp).Row
> sht.Rows("1:" & ShtLastRow).Copy _
> Destination:=SumSht.Rows(SumLastRow + 2)
> End If
> Next sht
>
> End Sub
>
> "Bob" wrote:
>
> > I have data in various tabs (some tabs have one row of data, others have
> > more) that I would like to move or copy into one worksheet. I would like to
> > use code to do this as some workbooks can have as much as 40 tabs while
> > others could have 10 tabs.

 
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
Move data from multiple tabs into one worksheet Supe Microsoft Excel Misc 2 18th Nov 2009 07:11 PM
copy/pasting data into a worksheet and then sorting worksheet Pierrette T Microsoft Excel Programming 0 11th Nov 2009 03:23 AM
copy multiple worksheet data from 2 different workbook Ita Microsoft Excel Programming 5 25th Nov 2008 11:03 PM
how to copy data from one worksheet to multiple worksheets at once zeb Microsoft Excel Worksheet Functions 2 21st Oct 2008 07:25 PM
Copy data from large worksheet into multiple workbooks richzip Microsoft Excel Programming 15 27th Feb 2008 12:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:06 AM.