dawnmichelle
New Member
- Joined
- Nov 21, 2023
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
I am using the below to consolidate several worksheets into a summary sheet within the same workbook. It was running fine until I saved and reopened the workbook and I have no clue why...... I did save it as a macro-enabled workbook and my security settings are correct. I have "debugged" and it runs through each line without generating an error. When I run the macro, it appears to be running through it but it is not actually doing anything (pulling data into the summary sheet). All thoughts are appreciated.
VBA Code:
Public Sub combine()
Dim ws As Worksheet, _
LR1 As Long, _
LR2 As Long
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "Summary" And ws.Name <> "MasterJE" And ws.Name <> "JE-B728" And ws.Name <> "JE-B545" And ws.Name <> "JE-B542" And ws.Name <> "JE-B541" And ws.Name <> "JE-B363" And ws.Name <> "JE-B225" And ws.Name <> "MasterIC" And ws.Name <> "JE Pivot" Then
LR1 = Sheets("Summary").Range("A" & Rows.Count).End(xlUp).Row + 1
LR2 = ws.Range("A" & Rows.Count).End(xlUp).Row
ws.Range("A7:L" & LR2).Copy Destination:=Sheets("Summary").Range("A" & LR1)
End If
Next ws
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: