• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Sequential Numbering

Ariff Chowdhury

New Member
Hello Excel Experts,

I have been looking for the macro since last week but with no luck till yet.

Would appreicate the efforts if you please get me out of the problem that i am facing,

I have created excel template (used it for coding list).


What i am looking for is that:


In Column B we need to put serial numbers (sequential numbers) in activecell based on the value specified in a two cells say (A1 = start serial from : 5) & (A2 = End serial number: 25)

What i need is in column B wherever the cell is active and start and end range is provided by me (user) and I click the macro button its generate the serial number with provided start and end range from activecell to downwards.


Hope you got my point.
 
The below vba code generating serial number in other columns as well but i want restrict user to insert serials only in column B,secondly if the start number is greater than end range it should pop up message to inform user that you have put wrong range.Similarily it should not overwrite any of the serial.(if user's active cell already has any serial number then it should inform user to clear the data first then run this macro to generate new serial numbers.


Sub Serial_numbers()


startNumber = [A1].Value

endNumber = [A2].Value


For i = startNumber To endNumber

ActiveCell.Offset(i - startNumber, 0) = i

Next i

End Sub
 
Back
Top