View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Unique ID number generation

the key would be to use an incremental number and store the last used value.
What method you use to do this would depend on who will use the workbook as
the stored value must be visible to all sources that would use it. The
excel 97 template uses the registry I believe, so this would not be useful
if the workbook were to be placed on a LAN (as an example). If you will
only use it on one computer, then you can use getsetting and putsetting to
retrieve from and write to the registry. Otherwise, you might want to
create a textfile to store the number and read and write to that (and design
the code to avoid conflicts).

--
Regards,
Tom Ogilvy

"Matt" wrote in message
...
There is an invoive template in 97 that allocates a unique
number to the invoice when asked. I am trying to
replicate the code so that every time the sheet I have
created is opened and a command button used the next
number in a series is added to the sheet uniquely
identifying it. Any ideas please?