If you want to Add serial no in column A automatically once you enter data in column B then try below code
steps.
1. Right click on sheet tab
2. select view code
3. Paste below code in sheet module
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Long
For i = 2 To Cells(Rows.Count, "B").End(xlUp).Row
If Cells(i, "B").Value <> "" Then
Cells(i, "A").Value = i - 1
End If
Next i
End Sub
Hi dear , i was looking for this code for long but i need my serial number to start from B7, can you help me . Thanks
ReplyDelete