View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bythsx-Addagio[_2_] Bythsx-Addagio[_2_] is offline
external usenet poster
 
Posts: 27
Default 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