Hi All,
I have a little VBA macro that combines the contents of the active sheets into 1 master table.
So I have Sheet Main (Where i run the macro from) and sheet 1,2,3.
This works fine but I added a couple of sheets for some calculations and other stuff. So now I have sheet 1,2,3,4,5 but I only want to Macro to do it's thing on Sheet 1,2,3. Currently it's grabbing all the tables form all the active sheets apart from the Main and this is sending it wrong as I pivot from the resulting master table.
The bit in bold is where I need to identify the sheets to include but I cannot remember the syntax. (Something like if sheet = 1,2,3 then do it)
Thanks
NJD
Sub NJD()
For Each sh In Worksheets If sh.Name <> ActiveSheet.Connect Then
With sh
.Range("A2:F" & .Range("A" & Rows.Count).End(xlUp).Row).Copy Range("A" & Range("A" & Rows.Count).End(xlUp).Row + 1)
End With
End If
Next sh
End Sub