Greetings,
I am working on a Macro that will consolidate 3 specific work sheets in my work book. I have it were it will consolidate all sheets but cannot get it to do just the 3 specific work sheets alone. Below is the Macro. I would like to only consolidate Sheets "Data1","Data2" and "Data3" into Sheet "Total"
Sub TotalSheets()
Dim cs As Worksheet, ws As Worksheet, LR As Long, NR As Long
Application.ScreenUpdating = False
If Not SheetExists("Total") Then _
Worksheets.Add(Before:=Sheets(1)).Name = "Total"
Set cs = Sheets("Total")
cs.Cells.Clear
Sheets(2).Rows(1).Copy cs.Range("A1")
NR = 2
For Each ws In Worksheets
If ws.Name <> "Total" Then
ws.Activate
LR = Range("A1").SpecialCells(xlCellTypeLastCell).Row
Range("A2:AA" & LR).Copy
cs.Range("A" & NR).PasteSpecial xlPasteValues
Application.CutCopyMode = False
NR = cs.Range("A" & Rows.Count).End(xlUp).Row + 1
End If
Next ws
cs.Activate
Columns("A:AA").AutoFit
Range("A1").Select
Application.ScreenUpdating = True
End Sub
Thanks for any help
Bookmarks