Converting code to R1C1 format

P

Paul

Hi-

is it possible to write this line of code in R1C1 format
instead of hardcoding the range? I want to be able to use
it multiple times without updating the cell reference
every time. Thanks!

Selection.AutoFill Destination:=Range("E19:AN19"),
Type:=xlFillDefault
 
D

Dave Peterson

How about:

With ActiveCell
.AutoFill Destination:=.Resize(1, 36), Type:=xlFillDefault
end with

But if you wanted to start in column E no matter where you were in that row:

With Cells(ActiveCell.Row, "E")
.AutoFill Destination:=.Resize(1, 36), Type:=xlFillDefault
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top