I am trying to find a way to generate GUIDs, which I've found, but I
need to ensure they are truly unique. Here is the script that
generates the GUIDs
Sub GenerateGUID()
Dim c As Long, r As Range
c = 1
Set r = Range("a2")
Do Until r.Cells(c, 1) = ""
Dim strGUID As String
Set TypeLib = CreateObject("Scriptlet.TypeLib")
strGUID = Left(TypeLib.GUID, 38)
r.Cells(c, 16).Value = strGUID
c = c + 1
Set TypeLib = Nothing
Loop
End Sub
Here is the script that scans for duplicates. I need a couple changes,
but I don't know how to do them. First, I need it to generate the
GUIDs with the above script. I'm guessing that can be a separate
process. Second, I need it to scan the list (column) it just made. If
it finds a duplicate, I need it to replace the entry with another
GUID, not delete it. Once it regenerates, I need it to rescan the list
from the beginning, finishing out with truly, verified, unique IDs.
Sub DelDups_OneList()
Dim iListCount As Integer
Dim iCtr As Integer
' Turn off screen updating to speed up macro.
Application.ScreenUpdating = False
' Get count of records to search through.
iListCount = Sheets("Sheet1").Range("A1:A100").Rows.Count
Sheets("Sheet1").Range("A1").Select
' Loop until end of records.
Do Until ActiveCell = ""
' Loop through records.
For iCtr = 1 To iListCount
' Don't compare against yourself.
' To specify a different column, change 1 to the column number.
If ActiveCell.Row <> Sheets("Sheet1").Cells(iCtr, 1).Row Then
' Do comparison of next record.
If ActiveCell.Value = Sheets("Sheet1").Cells(iCtr, 1).Value
Then
' If match is true then delete row.
Sheets("Sheet1").Cells(iCtr, 1).Delete xlShiftUp
' Increment counter to account for deleted row.
iCtr = iCtr + 1
End If
End If
Next iCtr
' Go to next record.
ActiveCell.Offset(1, 0).Select
Loop
Application.ScreenUpdating = True
MsgBox "Done!"
End Sub
Thanks for the help.
|
|
0
|
|
|
|
Reply
|
christopher
|
6/1/2010 4:34:16 AM |
|
|
0 Replies
1104 Views
(page loaded in 0.024 seconds)
Similiar Articles: Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ...I am trying to find a way to generate GUIDs, which I've found, but I need to ensure they are truly unique. Here is the script that generates the GUI... search column for duplicate value during data entry - microsoft ...Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ... how replace comma with point in import data ... search column for duplicate value during data entry ... Find duplicate, save in a list, delete duplicate using macro ...Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ... Find duplicate, save in a list, delete duplicate using macro ... Generate GUID, Find Duplicates ... how replace comma with point in import data - microsoft.public ...Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ... how replace comma with point in import data ... search column for duplicate value during data entry ... Macro for Finding Duplicate Data Entries - microsoft.public.word ...Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ... Check Duplicate with VBA - microsoft ... save in a list, delete duplicate using macro ... How to count duplicates... - microsoft.public.mac.office.excel ...Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ... Here is the script that scans for duplicates. I need a couple changes, but I don't know ... Don't Count Duplicates - microsoft.public.excel.misc ...Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ..... Loop End Sub Here is the script that scans for duplicates. I need a couple changes, but I don't ... macro to generate next number - microsoft.public.excel.misc ...Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ..... different column, change 1 to the column number. ... End If End If Next iCtr ' Go to next ... Replace Count - microsoft.public.vb.general.discussionGenerate GUID, Find Duplicates, Replace, Rescan - microsoft.public ... ' To specify a different column, change 1 to the column number. If ActiveCell.Row <> Sheets("Sheet1 ... Add comma during currency field entry - microsoft.public.access ...This seems like a simple request, but can't find the solution... ... during currency field entry - microsoft.public.access ... search column for duplicate ... Generate GUID, Find Duplicates, Replace, Rescan - microsoft.public ...I am trying to find a way to generate GUIDs, which I've found, but I need to ensure they are truly unique. Here is the script that generates the GUI... Generate GUID, Find Duplicates, Replace, Rescan - Excel Help ForumHere is the script that scans for duplicates. I need a couple changes, but I don't know how to do them. First, I need it generate the GUIDs with the above script. Generate GUID, Find Duplicates, Replace, RescanI am trying to find a way to generate GUIDs, which I've found, but I need to ensure they are truly unique. Here is the script that generates the GUIDs Excel - Create A Guid In Entire Column - Hi Folks Ive done ...Hi Folks, I've done a lot of programming and scripting, but ... Generate Guid, Find Duplicates, Replace, Rescan - Excel Batch Script to replace duplicate guids: duplicate, agentguidMorning, I created a batch script to replace duplicated McAfee guid and log which systems were updated, however we are now find systems with blank guids no ... 7/18/2012 5:58:49 PM
|