Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Dear all,
Please advise what's wrong with the code below to remove duplicates from a list to a listbox in an userform. A warning dialog box stated "variable not defined" to a word "Item" Sub RemoveDuplicates1() Dim AllCells As Range, Cell As Range Dim NoDupes As New Collection On Error Resume Next For Each Cell In Range("A1:A54") NoDupes.Add Cell.Value, CStr(Cell.Value) Next Cell On Error GoTo 0 For Each Item In NoDupes UserForm1.ListBox1.AddItem Item Next Item UserForm1.Show Unload UserForm1 End Sub Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
UserForm background was dotted, now plain? | Excel Discussion (Misc queries) | |||
coping and create new userform | Excel Discussion (Misc queries) | |||
Userform and variables | Excel Discussion (Misc queries) | |||
Cell Content from UserForm Not Retained | Excel Discussion (Misc queries) | |||
How can I run a macro in the background whilst a UserForm is visib | Excel Discussion (Misc queries) |