View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shing Shing is offline
external usenet poster
 
Posts: 1
Default AutoFilling To A Variable Number Of Rows


I'm new to programming in VBA so please have some patience with m
ignorance.

I am trying write some VBA code to AutoFill a column with a formula
Normally, I can just use:

Range("C1").Select
ActiveCell.FormulaR1C1 = "=RC[-2]/RC[-1]"
Range("C1").Select
Selection.AutoFill Destination:=Range("C1:C10"), Type:=xlFillDefault
Range("C1:C10").Select

The problem is, the number of rows is variable so I don't want to se
the number of rows finitely to 10.

How can I AutoFill the column to the number of rows that matches th
number of rows of data? I know there is an END property that exists
Can I use that?

Any help is greatly appreciated. Thanks in advance.

Regards,
Wai Shin

--
Shin
-----------------------------------------------------------------------
Shing's Profile: http://www.excelforum.com/member.php...fo&userid=3603
View this thread: http://www.excelforum.com/showthread.php?threadid=55822