T
tpeter
I need to number a form using autofill, the start cell is static but the end
cell is a variable. I have written the following code but I can't figure out
how to refer to the varable when autofilling. The code selects the entire
range but I can't figure out how to autofill from c15:LastCell. Thank you for
your help.
Sub num2()
'
' num2 Macro
' Macro recorded 10/23/2009 by tpeter
'
Dim LastCell As Range
Set LastCell = Range("C15").End(xlDown)
Range("C15").Select
ActiveCell.FormulaR1C1 = "1"
Range("C16").Select
ActiveCell.FormulaR1C1 = "2"
Range("C15:C16").Select
Selection.AutoFill Destination:=Range("C15:C30"), Type:=xlFillDefault
Range("C15:C28").Select
End Sub
cell is a variable. I have written the following code but I can't figure out
how to refer to the varable when autofilling. The code selects the entire
range but I can't figure out how to autofill from c15:LastCell. Thank you for
your help.
Sub num2()
'
' num2 Macro
' Macro recorded 10/23/2009 by tpeter
'
Dim LastCell As Range
Set LastCell = Range("C15").End(xlDown)
Range("C15").Select
ActiveCell.FormulaR1C1 = "1"
Range("C16").Select
ActiveCell.FormulaR1C1 = "2"
Range("C15:C16").Select
Selection.AutoFill Destination:=Range("C15:C30"), Type:=xlFillDefault
Range("C15:C28").Select
End Sub