How can we Insert Serial Numbers Automatically In Excel With VBA code ? can any one write the customized code to Insert Serial Numbers Automatically In Excel With VBA code?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
shree
Just create this macro to insert serial numbers in excel with VBA Code.
Sub InsertNumber()
Dim selectedRow, selectedColumnNumber, i, diff As Integer
diff = 0
selectedRow = Selection.Row
selectedColumnNumber = Selection.Column
Dim UptoThisNumber As Integer
UptoThisNumber = InputBox(“How Many Numbers:”, “Number Input”, 10)
For i = 1 To UptoThisNumber
Cells(selectedRow + ((i – 1) + diff), selectedColumnNumber + diff).Value = i + 4000
‘diff = diff + 2
Next i
End Sub