I'm using the following code to find the last row in Sheet1 & Sheet2
Dim 1LastRow As Long
Dim 2LastRow As Long
1LastRow = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
2LastRow = Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row
This works as initially expected, however I'd like "1LastRow" to adjust to dynamically pick up the last row.
For example, if Sheet1 initially has 50 rows, but after:
Sheets("Sheet2").Range("B2:B" & 2LastRow).Copy
Sheet1 now has 55 rows. However, "1LastRow" is still assuming that Sheet1 only has 50 rows, and thus creates inconsistencies throughout the rest of the code when "1LastRow" is used. Any input is greatly appreciated!