Below is the codes from my previous post
Option Explicit
Sub Sheets_CopyData()
Dim wks As Worksheet
Dim lngLastRow As Long
Dim lngRow As Long
'// For ea worksheet in this workbook... //
For Each wks In ThisWorkbook.Worksheets
'// If the worksheet's name starts with "WP" and has four digits after... //
If wks.Name Like "WP####" Then
'// Since I figure the WP# is required, used Col A to run up and see where //
'// the last value is... //
lngLastRow = wks.Cells(Rows.Count, 1).End(xlUp).Row
'// ...now search from that row, to row 7, (searching in Col L), and we'll see //
'// if/where we find our marker ("Copied"). //
For lngRow = lngLastRow To 7 Step -1
If Not InStr(1, wks.Cells(lngRow, 12).Value, "Copied", vbTextCompare) = 0 Then
Exit For
End If
Next
'// Now if the last row (in Col A) that had a value in it, is farther down //
'// than the last row (in Col L) that has a 'marker', we know we have rows //
'// to copy. //
If lngLastRow > lngRow Then
wks.Range("A" & lngRow + 1 & ":K" & lngLastRow).Copy _
ThisWorkbook.Worksheets("Summary").Range("A" & _
ThisWorkbook.Worksheets("Summary") _
.Cells(Rows.Count, 1).End(xlUp).Row + 1 _
)
'// Then we'll refresh what row is 'marked' so we don't recopy the //
'// same info. //
wks.Range("L" & lngLastRow).Value = "Copied"
End If
End If
Next
End Sub