Good evening
I wonder if anyone can tell me if there is a shorter way of writing the below code - perhaps a 'For Next Loop?
There are 40 Lines to be wrtten, with the target cell and the formula referenced cell increasing by one each time.
With ActiveSheet
.Range("A181").Formula = "=IF($AA$2<2,"""",A180+2)"
.Range("A182").Formula = "=IF($AA$2<2,"""",A181+2)"
.Range("A183").Formula = "=IF($AA$2<2,"""",A182+2)"
.Range("A184").Formula = "=IF($AA$2<2,"""",A183+2)"
.Range("A185").Formula = "=IF($AA$2<2,"""",A184+2)"
etc....
End With
Any help much appreciated.
I wonder if anyone can tell me if there is a shorter way of writing the below code - perhaps a 'For Next Loop?
There are 40 Lines to be wrtten, with the target cell and the formula referenced cell increasing by one each time.
With ActiveSheet
.Range("A181").Formula = "=IF($AA$2<2,"""",A180+2)"
.Range("A182").Formula = "=IF($AA$2<2,"""",A181+2)"
.Range("A183").Formula = "=IF($AA$2<2,"""",A182+2)"
.Range("A184").Formula = "=IF($AA$2<2,"""",A183+2)"
.Range("A185").Formula = "=IF($AA$2<2,"""",A184+2)"
etc....
End With
Any help much appreciated.