I need to write 40 lines of code in which only two cell references change in each line. Can I do a 'For Next Loop' for this instead, and if so how would this be constructed?
The code I have is:
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 assistance on this would be greatlyappreciated.
Many thanks
The code I have is:
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 assistance on this would be greatlyappreciated.
Many thanks