Jump to content

Recommended Posts

Posted

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!

Posted
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
Posted

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

 

Capture.PNG

 

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 :D)

 

Example spreadsheet attached, (Note needs macro enabled)

 

TestCounter.zip

 

Steve

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...