Create a counter in Excel using VBA

Tomax -  
Deathmann Posted messages 243 Status Membre -
Hello,

I am looking for a solution to create a counter in Excel.

I have a macro that runs to record values entered in fields.
It copies these values into a database in an external file.

I would like to create an ID for each entry recorded by the macro.
And for this ID to be automatically incremented...

Basically, when I click on my "save" button, the macro not only copies my data but also increments an ID value and saves it along with the other data in the table.
If possible, I would like a pop-up to inform me of my recording number afterwards...

(All this so that I can later refer back to my database by indicating the ID to modify the entry.. PHEW...)

I know it's complicated, but I'm counting on you :)

Thank you

Configuration: Windows XP / Safari 534.30

1 réponse

Deathmann Posted messages 243 Status Membre 59
 
In short, you want to implement a number that increases by 1 for each value, nothing simpler, just a little loop in VBA

For i=1 To 'number_of_values' i=i+1 Next i


You just need to display your i somewhere afterwards.

Best regards.
--
CCM is our friend, a loyal friend, but Google is our Best friend, it must be known that a Best friend should always be consulted first. Thank you
2