Hi All,
I'm trying to write a vba loop script for a list of numbers.
The scrip should do:
1. Check if the numbers identical.
2. If the numbers identical give a serial number that will count the identical numbers.
3. if The numbers do not match, then start a new series of serial numbers counting.
I have the script for the serial number.
Can you please help me with the script so it will have the conditional part – so the serial number counting will start over when the number in the list changes.
Thanks
Sub counter()
For i = 1 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(i, "B").Value <> "" Then
Cells(i, "A").Value = i - 0
End If
Next i
End Sub
The final result should look like this (the colores are not needed)
I'm trying to write a vba loop script for a list of numbers.
The scrip should do:
1. Check if the numbers identical.
2. If the numbers identical give a serial number that will count the identical numbers.
3. if The numbers do not match, then start a new series of serial numbers counting.
I have the script for the serial number.
Can you please help me with the script so it will have the conditional part – so the serial number counting will start over when the number in the list changes.
Thanks
Sub counter()
For i = 1 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(i, "B").Value <> "" Then
Cells(i, "A").Value = i - 0
End If
Next i
End Sub
The final result should look like this (the colores are not needed)