-
Flexible address for autofill
Hi,
I am working on a flexible code which does auto-filling in excel spreadsheet.
The algorithm I thought of is using address as the reference to where the auto fill should be. However, I cannot get this code to work
Range("A1").Select
col0 = ActiveCell.Column
ActiveCell.Offset(0, 1).Select
add1 = ActiveCell.address
col1 = ActiveCell.Column
ActiveCell.Value = 1
ActiveCell.Offset(1, 0).Select
add2 = ActiveCell.address
ActiveCell.Value = 2
Range(add1, add2).autofill Destination:=Range(add1,col1 & Range(col1 & Rows.Count).End(xlUp).Row)
The part that failed is in the last line, I am not sure how to modify that.
Thanks.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules