Good morning all,
I have the macro below that copies all of my worksheets into one consolidated sheet. Can any help me to change this macro so that it only copy.paste.values all of the sheets into the "Consolidated" sheet. Some of the formulas are causing issues when copied over.
Thanks so much for your time.
Sub CON()
Dim lr As Long, lr2 As Long, ws As Worksheet
Application.ScreenUpdating = False
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = "Consolidated"
Sheets("Sheet1").Rows("2:2").Copy Destination:=Sheets("Consolidated").Rows("1:1")
lr2 = Sheets("Consolidated").Cells(Rows.Count, "A").End(xlUp).Row
For Each ws In Worksheets
If ws.Name <> "Consolidated" Then
ws.Activate
If ws.Range("A1") <> "" Then
lr = Cells(Rows.Count, "A").End(xlUp).Row
Rows("3:" & lr).Copy Destination:=Sheets("Consolidated").Rows(lr2 + 1)
End If
End If
lr2 = Sheets("Consolidated").Cells(Rows.Count, "A").End(xlUp).Row
Next ws
Application.ScreenUpdating = True
End Sub
I have the macro below that copies all of my worksheets into one consolidated sheet. Can any help me to change this macro so that it only copy.paste.values all of the sheets into the "Consolidated" sheet. Some of the formulas are causing issues when copied over.
Thanks so much for your time.
Sub CON()
Dim lr As Long, lr2 As Long, ws As Worksheet
Application.ScreenUpdating = False
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = "Consolidated"
Sheets("Sheet1").Rows("2:2").Copy Destination:=Sheets("Consolidated").Rows("1:1")
lr2 = Sheets("Consolidated").Cells(Rows.Count, "A").End(xlUp).Row
For Each ws In Worksheets
If ws.Name <> "Consolidated" Then
ws.Activate
If ws.Range("A1") <> "" Then
lr = Cells(Rows.Count, "A").End(xlUp).Row
Rows("3:" & lr).Copy Destination:=Sheets("Consolidated").Rows(lr2 + 1)
End If
End If
lr2 = Sheets("Consolidated").Cells(Rows.Count, "A").End(xlUp).Row
Next ws
Application.ScreenUpdating = True
End Sub