View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Fill formula down using macro

Const formulaStartingCell As String = "C2"
Dim lastrow As Long
'replace A to the column that will always be the last row
lastrow = Range("A" & Rows.Count).End(xlUp).Row

Range(formulaStartingCell).Activate
Selection.AutoFill Destination:=Range(formulaStartingCell & ":C" &
lastrow), Type:=xlFillDefault

"Charles" wrote:

hi, using VBA I would like to fill a formula down to end of my data rather
than to a fixed cell as the size of my data is different each time I run my
macro.