I have this code in the "This Workbook" section. It functions well, but not perfectly. I'd like for it to continue the copy and paste routine until the value in column BZ, in the LastRow, = "Current". For some reason, it only pastes 2 or 3 rows at a time. What change do I need to make to the code, to get the desired result?
Code:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)'Copies the last row, if the Pymt Stats = Paid or Late, and pastes it to the row below.
Application.ScreenUpdating = False
Dim ws As Worksheet
Dim LastRow As Long
For Each ws In Worksheets
If Not ws.Name = "Displays" And Not ws.Name = "Management" And Not ws.Name = "Summaries" And Not ws.Name = "Bios" And Not ws.Name = "Stats" _
And Not ws.Name = "Appt Tracker" And Not ws.Name = "Pymt Tracker" And Not ws.Name = "Financials" And Not ws.Name = "Variables" Then
LastRow = ws.Range("BZ" & ws.Rows.Count).End(xlUp).Row
If ws.Range("BZ" & LastRow).Value = "Paid" Or ws.Range("BZ" & LastRow).Value = "Late" Then
ws.Range("A" & LastRow + 1) = "=Today()"
ws.Range("B" & LastRow + 1) = Now()
ws.Range("C" & LastRow + 1) = "Update"
ws.Range("D" & LastRow & ":U" & LastRow).Copy ws.Range("D" & LastRow + 1)
ws.Range("W" & LastRow & ":AF" & LastRow).Copy ws.Range("W" & LastRow + 1)
ws.Range("AG" & LastRow & ":AO" & LastRow).Copy ws.Range("AG" & LastRow + 1)
ws.Range("AQ" & LastRow & ":AY" & LastRow).Copy ws.Range("AQ" & LastRow + 1)
ws.Range("BA" & LastRow & ":BI" & LastRow).Copy ws.Range("BA" & LastRow + 1)
ws.Range("BK" & LastRow & ":BZ" & LastRow).Copy ws.Range("BK" & LastRow + 1)
ws.Range("BR" & LastRow + 1).Value = 0
ws.Range("BS" & LastRow + 1).Value = 0
ws.Range("BT" & LastRow + 1).Value = 0
ws.Range("BU" & LastRow + 1).Value = 0
ws.Range("BV" & LastRow + 1).Value = 0
End If
End If
Next ws
Application.Calculation = xlCalculationAutomatic
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = True
End Sub