Reputation: 1
Set cell_range=activecell
Range("o18").Select
ActiveCell.FormulaR1C1 = "=iferror(RC[-4]*RC[-3]-RC[-4]*RC[-3]*RC[-1]%,0)"
Range("O18").Select
Selection.AutoFill Destination:=Range("O18:O52"), Type:=xlFillDefault
I want to change O52 to cell_range but it shows error.
Upvotes: 0
Views: 43
Reputation: 364
set 2 variabves - activecell row and acivecesll column and set autofill range via Cells()
aRow=Activecell.Row
aCol=Activecell.Column
....
and Selection.AutoFill Destination:=Range(Cells(18,15),Cells(aRow,aCol)), Type:=xlFillDefault
Upvotes: 1