Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Relative range syntax
Hello,
I am running a loop which inserts a formula across cells in row 4 depending on the value of g. I then would like to auto fill that formula down to the below 14 rows. ex. for column B. Cells(4, g + 2).AutoFill Destination:=Range("B4:B18"), Type:=xlFillDefault How can I write this so I can use the active column instead of the static "B4:B14" I was thinking of setting a range by: set rng1 = range(R[1]C:R[14]C) Then Cells(4, g + 2).AutoFill Destination:=rng1, Type:=xlFillDefault It doesn't work however. Any suggestions? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Relative range syntax
Try this (not tested):
Cells(4, g + 2).AutoFill Destination:=Range(Cells(4, g + 2), Cells(14, g + 2)), Type:=xlFillDefault Regards, Stefi Bythsx-Addagio ezt *rta: Hello, I am running a loop which inserts a formula across cells in row 4 depending on the value of g. I then would like to auto fill that formula down to the below 14 rows. ex. for column B. Cells(4, g + 2).AutoFill Destination:=Range("B4:B18"), Type:=xlFillDefault How can I write this so I can use the active column instead of the static "B4:B14" I was thinking of setting a range by: set rng1 = range(R[1]C:R[14]C) Then Cells(4, g + 2).AutoFill Destination:=rng1, Type:=xlFillDefault It doesn't work however. Any suggestions? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Syntax for a relative formula | Excel Worksheet Functions | |||
Syntax help with range | Excel Programming | |||
How to get relative range? | Excel Programming | |||
syntax for relative cell change and looping | Excel Programming |