Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro to Compile Data from Different Sheets

I have an issue which I think will be fairly easy to solve, but my Google searches have been unfruitful.

I have 50+ sheets with data in table form. The headers in each sheet are consistent and the header range for each tab is A4:AE4. However each sheet will have varying amount of data entered down the rows.

Each that needs the data compiled is name as “J-“ as the first 2 characters. This way I know which sheets I need to pull from.

I have a tab that I call “Master” that will compile all the data.

I need a macro that will find each sheet with the “J-“, find the number of active rows in that sheet and then copy all the information from the table over in the Master sheet (less the header in row 4).

Once the data is copied over to the Master from the first sheet, it will copy over the data from sheet 2 directly below the information from sheet 1. Once it has found and copied all the data from the “J-“ tabs, it is complete.

Any feedback would be most helpful. Thank you in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Macro to Compile Data from Different Sheets

Hi,

Am Sat, 19 Oct 2013 09:42:31 -0700 (PDT) schrieb djc:

I have an issue which I think will be fairly easy to solve, but my Google searches have been unfruitful.

I have 50+ sheets with data in table form. The headers in each sheet are consistent and the header range for each tab is A4:AE4. However each sheet will have varying amount of data entered down the rows.

Each that needs the data compiled is name as ?J-? as the first 2 characters. This way I know which sheets I need to pull from.


try:

Sub Test()
Dim LRow As Long
Dim wsh As Worksheet

For Each wsh In ThisWorkbook.Worksheets
If Left(wsh.Name, 2) = "J-" Then
With wsh
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("A5:AE" & LRow).Copy _
Sheets("Master").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
End With
End If
Next
End Sub


Regards
Claus B.
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Macro to Compile Data from Different Sheets

Works beautifully. Thank you!
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
HOW CAN I COMPILE 2 SHEETS? Sweeney * New Users to Excel 2 October 19th 09 05:08 PM
Sub to compile data from col A in many identical sheets Max Excel Programming 2 August 4th 08 03:31 PM
Compile data on multiple sheets. Alden Excel Programming 0 July 26th 07 04:08 AM
macro to compile columns on multiple sheets simonsmith Excel Discussion (Misc queries) 2 May 9th 06 04:06 PM
Compile Different sheets in one sheet Bijan1231 Excel Discussion (Misc queries) 1 January 24th 06 06:31 AM


All times are GMT +1. The time now is 08:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"