Hello,
I have code where I am looking to autofill a selected range to the last row of data. I generally know how to build the code correctly, but I have a problem with the beginning of the range.
The first line of code was written so people can follow, but it will change as it is a loop macro and I have a relative reference. The issue in the code is obviously the last line. Generally it would be the following:
where an actual row is given for the first set of range. However, since this row number can always change, how can I build it to accomodate my needs? The columns will always be E & F.
Don't worry about Column A as LR. I need it to be that way.
Any help would be greatly appreciated!
I have code where I am looking to autofill a selected range to the last row of data. I generally know how to build the code correctly, but I have a problem with the beginning of the range.
Code:
Range("E2:F2").Select
Selection.PasteSpecial xlPasteValues
LR = Range("A" & Rows.Count).End(xlUp).Row
Selection.AutoFill Destination:=Range("E:F" & LR)
The first line of code was written so people can follow, but it will change as it is a loop macro and I have a relative reference. The issue in the code is obviously the last line. Generally it would be the following:
Code:
Selection.AutoFill Destination:=Range("E2:F" & LR)
where an actual row is given for the first set of range. However, since this row number can always change, how can I build it to accomodate my needs? The columns will always be E & F.
Don't worry about Column A as LR. I need it to be that way.
Any help would be greatly appreciated!