abberyfarm
Well-known Member
- Joined
- Aug 14, 2011
- Messages
- 733
Hi,
I recorded the macro below which applies a formula to range in Col C.
Would anybody know how I can modify it to apply the formula down as far as the last used row in Col B? As the formula uses values from Column B.
Appreciate any help
Thanks
I recorded the macro below which applies a formula to range in Col C.
Would anybody know how I can modify it to apply the formula down as far as the last used row in Col B? As the formula uses values from Column B.
Appreciate any help
Thanks
Code:
Range("C2").Select
Selection.FormulaArray = _
"=IF(LEFT(TEXT(RC[-2],""dd/mm/yyyy hh:mm""),13)=LEFT(TEXT(R[1]C[-2],""dd/mm/yyyy hh:mm""),13),"""",AVERAGE(IF(LEFT(TEXT(R2C1:R[COLOR=#00ff00]10463[/COLOR]C1,""dd/mm/yyyy hh:mm""),13)=LEFT(TEXT(RC[-2],""dd/mm/yyyy hh:mm""),13),R2C2:R[COLOR=#00ff00]10463[/COLOR]C2)))"
Selection.AutoFill Destination:=Range("C2:C[COLOR=#00ff00]10463[/COLOR]")