Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique ID
I am trying to insert a unique ID for each row in multiple sheets that are
not connected but the data will later be combined (so I need the unique ID to be unique). I thought I would use the following code: Dim GId As Guid = Guid.NewGuid() but I get an error message that it is not supported in VBA. I'm sure many people have this same problem and there must be a preferred method. I would appreciate any advise. Ron |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique ID
A common way to do this is to use the date and time functions, along with
some prefix, like this: ="SS" & year(now) & month(now) & day(now) & hour(now) & minute(now) & second(now) Each ID assigned will obviously be unique. Stan Scott New York City "Ron Rasmussen" <Ron wrote in message ... I am trying to insert a unique ID for each row in multiple sheets that are not connected but the data will later be combined (so I need the unique ID to be unique). I thought I would use the following code: Dim GId As Guid = Guid.NewGuid() but I get an error message that it is not supported in VBA. I'm sure many people have this same problem and there must be a preferred method. I would appreciate any advise. Ron |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique ID
I think your right...I can randomize the first few characters and that should
do it. I have several thousand users worldwide. Thanks again. Ron "Stan Scott" wrote: A common way to do this is to use the date and time functions, along with some prefix, like this: ="SS" & year(now) & month(now) & day(now) & hour(now) & minute(now) & second(now) Each ID assigned will obviously be unique. Stan Scott New York City "Ron Rasmussen" <Ron wrote in message ... I am trying to insert a unique ID for each row in multiple sheets that are not connected but the data will later be combined (so I need the unique ID to be unique). I thought I would use the following code: Dim GId As Guid = Guid.NewGuid() but I get an error message that it is not supported in VBA. I'm sure many people have this same problem and there must be a preferred method. I would appreciate any advise. Ron |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Unique ID
Hi Ron,
You can test Sub CreateGUID() MsgBox Left(CreateObject("Scriptlet.TypeLib").GUID, 38) End Sub Regards, MP "Ron Rasmussen" <Ron a écrit dans le message de ... I am trying to insert a unique ID for each row in multiple sheets that are not connected but the data will later be combined (so I need the unique ID to be unique). I thought I would use the following code: Dim GId As Guid = Guid.NewGuid() but I get an error message that it is not supported in VBA. I'm sure many people have this same problem and there must be a preferred method. I would appreciate any advise. Ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filer for unique records and return all column data for unique rec | Excel Discussion (Misc queries) | |||
How to pick out unique components in a list with unique and common | Excel Discussion (Misc queries) | |||
Attempting to sort unique/only count first record in each unique g | Excel Discussion (Misc queries) | |||
unique filter results in some non-unique records. | Excel Discussion (Misc queries) | |||
Formulas for...1. Counting unique cells 2. Display unique contents | Excel Programming |