redspanna
Well-known Member
- Joined
- Jul 27, 2005
- Messages
- 1,602
- Office Version
- 365
- Platform
- Windows
Hi all
I have been helped with following code to place a formula into certain cell
how can I extend the code so that the formula is autofilled 'x' number of rows down , where 'x' is the number found in cell ref A3
thanks in advance
I have been helped with following code to place a formula into certain cell
Code:
Sub fillformula()
Dim lr As Long
lr = Cells(Rows.Count, "G").End(xlUp).Row + 1
Range("G" & lr).Formula = "=SUMPRODUCT(--(ABS(F$" & lr & ":F$" & lr + Range("A3").Value & ")>ABS(F" & lr & ")))+1"
End Sub
how can I extend the code so that the formula is autofilled 'x' number of rows down , where 'x' is the number found in cell ref A3
thanks in advance