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
|