There are several ways to accomplish something like this.What *I* would do 
personally is something like:Using VBA, I'd create a Dictionary object and 
cycle through the records, inserting entries in the Dictionary Object, thereby 
creating an array of unique values.Then, use the statement:sArray = 
Dict_Obj.keys
to create an array of these unique values.
I'd probably sort the array, then use it to load a userform listbox that allows 
multiple selections.
I created a userform (called Form_Records)that contained one listbox called 
Lst_Typeand a button called "Btn_Delete".
Then I created these two macros that I tested on a file with 130,000 records.
-----------------------Option Explicit
Private Sub Btn_Delete_Click()
    Dim Dict_Type, tArray
    Dim nRows, nRow
    Set Dict_Type = CreateObject("Scripting.Dictionary")
        Dict_Type.RemoveAll
    For nRow = 0 To Form_Records.Lst_Type.ListCount - 1
        If (Form_Records.Lst_Type.Selected(nRow)) Then
            Debug.Assert True
            Dict_Type.Add Form_Records.Lst_Type.List(nRow), nRow
        End If
    Next nRow
    Application.ScreenUpdating = False
    nRows = Application.WorksheetFunction.CountA(ActiveSheet.Range("A:A"))
    For nRow = nRows To 2 Step -1
        If (Dict_Type.exists(ActiveSheet.Cells(nRow, "A").Value)) Then
            Cells(nRow, "A").EntireRow.Delete
        End If
    Next nRow
    Application.ScreenUpdating = True
    Unload Form_Records
    MsgBox "Finished"
End SubPrivate Sub UserForm_Initialize()
    Dim Dict_Type, tArray
    Dim nRows, nRow
    Set Dict_Type = CreateObject("Scripting.Dictionary")
        Dict_Type.RemoveAll
    nRows = Application.WorksheetFunction.CountA(ActiveSheet.Range("A:A"))
    For nRow = 2 To nRows
        If (Not Dict_Type.exists(ActiveSheet.Cells(nRow, "A").Value)) Then
                Dict_Type.Add ActiveSheet.Cells(nRow, "A").Value, nRow
        End If
    Next nRow
    Form_Records.Lst_Type.Clear
    tArray = Dict_Type.keys
    For nRow = 0 To UBound(tArray)
        Form_Records.Lst_Type.AddItem tArray(nRow)
    Next nRowEnd Sub



Paul-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
----------------------------------------- 

    On Friday, October 14, 2016 11:54 AM, kalimotxo <jamison.foll...@gmail.com> 
wrote:
 

 Hello,
I'm running a macro to process some data over several columns. At a midway 
point of the code, I need the macro to bring up a list of possible names. The 
user then can check the ones they do not want, click OK, and then the macro 
will go on to delete all records connected to that name.
The names are in column A, and repeat.
How can I call up a list of all unique names in column A, with a check box 
available for the user to scroll through and pick all the names they wish to?-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel
 
FORUM RULES
 
1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.
 
NOTE : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.


   

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at https://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to