Nawa Posted August 15, 2011 Posted August 15, 2011 Do you know of any program, or template which will help me generate the next available number. We have numbers for PC like 001, 002, 005, 008 now if I need to add a new number, I want the program to give me either 006/007/009. Thank you for your support!
Steve21 Posted August 15, 2011 Posted August 15, 2011 In what context? Do you want just a counter in a spreadsheet? script? Do you want it to automatically read AD? Or what? Steve
Nawa Posted August 15, 2011 Author Posted August 15, 2011 Thanks for your response steve21. I'm a novice at this. I need any program or templete which is easy to use. The program must generate the next available number automatically. Is there anything that I can use withought the codes? If not which one can you recommend for a begginer. Thanks
Steve21 Posted August 15, 2011 Posted August 15, 2011 Easiest way to do it would be something like this in excel: Sub Button1_Click() Range("M1").Select Do Until ActiveCell = "STOP" If ActiveCell = "" Then a = ActiveCell.Row ActiveCell = "Used" Range("A1").Select ActiveCell = a Exit Sub Else ActiveCell.Offset(1, 0).Select End If Loop End Sub Will search through the column of numbers, finding the next free one. It'll then post that number in A1, and fill in the spot so next time you search it'll find next one etc etc. (STOP just breaks it out of the loop so it doesn't go on forever ) Example spreadsheet attached, (Note needs macro enabled) TestCounter.zip Steve
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now