Experts Exchange connects you with the people and services you need so you can get back to work.
Dim xRows As Long
Dim xResponse As Long
Dim xLast_Row As Long
Dim xOutput As Long
Dim xSummary As Worksheet
Dim xSheet As Variant
Set xSummary = Sheets("Summary")
xRows = xSummary.UsedRange.Cells(1, 1).Row + xSummary.UsedRange.Rows.Count - 1
If xRows > 1 Then
xResponse = MsgBox("Data found in the Summary sheet (" & xRows & " rows)." & Chr(10) & "'OK' to delete them, 'Cancel' to quit.", vbOKCancel, "List Job Numbers")
If xResponse = 2 Then
MsgBox ("User chose to quit.")
xSummary.Range("2:" & xRows).Delete
xRows = 1
Application.ScreenUpdating = False
For Each xSheet In Array("Sheet1", "Sheet2", "Sheet3", "Sheet4", "Sheet5", "Sheet6")
xLast_Row = .UsedRange.Cells(1, 1).Row + .UsedRange.Rows.Count - 1
If xLast_Row > 1 Then
.Range("E2:E" & xLast_Row).Copy Destination:=xSummary.Range("A" & xRows + 1)
xRows = xRows + xLast_Row - 1
Application.ScreenUpdating = True
MsgBox ("Run complete - " & xRows - 1 & " entries copied.")
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Premium members get this course for $349.00.
Premium members get this course for $122.40.
Premium members get this course for $389.00.
Premium members get this course for $159.20.