Unique Worksheet ID

S

sreidpe

Hi,
Can anyone help me to create a unique ID for a spreadsheet. I have
spreadsheet which is used to calculate the required components of
formulation. The details of the formulation are copied to anothe
worksheet which becomes a "request form" which the user then sends t
our manufacturing plant.

I would like each request to have a unique identifier. I have though
about taking part of the requestors name and linking it to the no
(date and time)functions but this will change each time the spreadshee
is opened. How can I just attach the date and time of creation?

Any other ideas?
Thanks Sand
 
H

Harald Staff

Hi Sandy

Here's a possible VBA solution. (You need VBA for this, formulas won't do
this kind of job.)

Sub Auto_open()
If Sheets(1).Range("A1").Value = "" Then _
Sheets(1).Range("A1").Value = _
Application.UserName & "_" & _
Format$(Now, "yymmdd_hhmmss")
End Sub

HTH. Best wishes Harald
 
S

sreidpe

Thanks, Harald,
I tried a work around with a macro recording copying the current time
and doing a paste special of just the values and then joining the date
to part of the name. It works but is not as elegant.
Sandy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top