I've defined the last row and column as follows:
Dim lastcolumn As Long
Dim totalrow As Long
' Initialize to start at bottom of column D
totalrow = ws1.Cells(Rows.Count, "D").End(xlUp).Row
' Define last column in row 16
lastcolumn = ws1.Cells(16, Columns.Count).End(xlToLeft).Column
I'm trying to set a range from K16 through the last column and last row and filldown. Columns are being added and causing me to manually change the last column reference from my original code. How can I reference this? Below is what I tried, but it's not working.
ws1.Range("k16:" & lastcolumn & totalrow).Select
Dim lastcolumn As Long
Dim totalrow As Long
' Initialize to start at bottom of column D
totalrow = ws1.Cells(Rows.Count, "D").End(xlUp).Row
' Define last column in row 16
lastcolumn = ws1.Cells(16, Columns.Count).End(xlToLeft).Column
I'm trying to set a range from K16 through the last column and last row and filldown. Columns are being added and causing me to manually change the last column reference from my original code. How can I reference this? Below is what I tried, but it's not working.
ws1.Range("k16:" & lastcolumn & totalrow).Select