I have the following macro to write the value in column 1 based on the available value in column 2 and 3
But I want to see the column1 value like this pattern
Col1 Col2 Col3
1 1 0
1 2 1
1 2 1
1 2 1
2 2 0
2 3 1
2 3 1
2 3 1
2 3 1
2 3 1
1 2 1
1 2 1
3 1 0
3 2 1
3 2 1
3 2 1
3 2 1
3 2 1
4 2 0
4 3 1
4 3 1
4 3 1
4 3 1
3 2 1
3 2 1
5 1 0
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
6 2 0
6 3 1
6 3 1
6 3 1
6 3 1
5 2 1
5 2 1
5 2 1
Code:
Sub ColumnValue()
Range("A18").Value = "=IF($B$18=0,0,1)"
Range("A19").Resize(Cells(Rows.Count, "B").End(xlUp).Row - 18) = "=IF(C19=1,A18,IF(C19=0,A18+1,""""))"
End Sub
But I want to see the column1 value like this pattern
Col1 Col2 Col3
1 1 0
1 2 1
1 2 1
1 2 1
2 2 0
2 3 1
2 3 1
2 3 1
2 3 1
2 3 1
1 2 1
1 2 1
3 1 0
3 2 1
3 2 1
3 2 1
3 2 1
3 2 1
4 2 0
4 3 1
4 3 1
4 3 1
4 3 1
3 2 1
3 2 1
5 1 0
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
5 2 1
6 2 0
6 3 1
6 3 1
6 3 1
6 3 1
5 2 1
5 2 1
5 2 1