I'm adding records to an existing sheet, and trying to update certain columns with "pre-set data". I've got the code below, which does everything I want, except for update the records.
When I step through the code, I see:
Data ends in Column A, at row 595. tLastRow is identifying the correct row.
Data ends in Column U, at row 600. aLastRow is identifying the correct row.
But no updates are occurring.
What am I missing?
When I step through the code, I see:
Data ends in Column A, at row 595. tLastRow is identifying the correct row.
Data ends in Column U, at row 600. aLastRow is identifying the correct row.
But no updates are occurring.
Code:
Sub CompleteSetup()
Application.ScreenUpdating = False
Dim mws2 As Worksheet
Set mws2 = ThisWorkbook.Sheets("Active_Inv")
tLastRow = mws2.Range("A" & Rows.Count).End(xlUp).Row
aLastRow = mws2.Range("U" & Rows.Count).End(xlUp).Row
Do Until aLastRow
mws2.Range("A" & tLastRow + 1) = "=Today()"
mws2.Range("B" & tLastRow + 1) = Format(Now(), "MM/DD/YY")
mws2.Range("C" & tLastRow + 1) = "=Workday(RC[27],10)"
mws2.Range("D" & tLastRow + 1) = "=RC[-1]-RC[-3]"
mws2.Range("E" & tLastRow + 1) = "=IF(RC[-1]<0,""Past Due"",IF(RC[-1]<4,""0 - 3"",IF(RC[-1]<8,""4 - 7"",""8 - 10"")))"
mws2.Range("S" & tLastRow + 1) = "=IF(RC[-7] = ""Y"",""Complete - Exception"",IF(RC[-5]="""",""Pending Initial Review"",IF(RC[-3]="""",""Pending Secondary Review"",IF(RC[-2]="""",""Pending ILQA Review"",IF(RC[-1]="""",""Pending EOD Completion"",""Complete"")))))"
Loop
Application.ScreenUpdating = True
End Sub
What am I missing?