Hi, I have very little idea of how to program in VBA but I've managed so far by consulting internet forums to obtain the following code to do what I need, but I am getting an error and I don't know what is wrong? Here is the code:
Public Sub formula1()
Dim Range1, Range2, Range3, Range4, Range5 As Range
Range1 = Range("O3").formula = "=IF(L3="",IF(AND(L3="",L4=""),0,1),100)"
Range2 = Range("P3").formula = "=IF(L3="",IF(AND(L3="",L4=""),P2,P2),P2+1)"
Range3 = Range("Q3").formula = "=IF(L3="",IF(L4="",IF(R4="",ROUND(Q2+1,0),Q2+0.0001),ROUND(Q2+1,0)),IF(AND(L3="",L4=""),Q2+0.0001,IF(L4="",Q2+0.0001,ROUND(Q2+1,0))))"
Range4 = Range("R3").formula = "=IF(L3="",R2&CHAR(10)&M3,M3)"
Range5 = Range("O3:R" & Range("a65000").End(xlUp).Row).FillDown
End Sub
Bookmarks