Im trying to develop a function in excel via VBA, i write the syntax below, but it's always wrong(i don't know why)!the message of error says: Else Cells.Value(i, 2) not correct, please if there is a problem in the syntax help me to correct it
Dim i As Integer
i = 2
While Cells(i, 1).Value <> 0
If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
Cells(i, 2).Value = 0
Else
Cells(i, 2).Value
End If
i = i + 1
Wend