Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time sensitive please help!
I have some code and it works fine for me on my computer. But when i send it
to someone else and they open it. It comes up with a compile error "cant find library" Here is the code any idea what might be causing this? Sub RemoveDuplicates() Dim AllCells As Range, Cell As Range Dim NoDupes As New Collection Set AllCells = Sheet1.Range("H2:H1000") ' The next statement ignores the error caused ' by attempting to add a duplicate key to the collection. On Error Resume Next For Each Cell In AllCells NoDupes.Add Cell.Value, CStr(Cell.Value) ' Note: the 2nd argument (key) for the Add method must be a string Next Cell ' Resume normal error handling On Error GoTo 0 ' Add the sorted, non-duplicated items to a ListBox For Each Value In NoDupes On Error Resume Next UserForm3.ListBox1.AddItem Value Next Value ' Show the UserForm UserForm3.Show End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time sensitive please help!
Have a look at Tools, References, and see if anything is marked as misssing.
It may be that you have set a reference to a component that they do not have. -- Robin Hammond www.enhanceddatasystems.com "Ewing25" wrote in message ... I have some code and it works fine for me on my computer. But when i send it to someone else and they open it. It comes up with a compile error "cant find library" Here is the code any idea what might be causing this? Sub RemoveDuplicates() Dim AllCells As Range, Cell As Range Dim NoDupes As New Collection Set AllCells = Sheet1.Range("H2:H1000") ' The next statement ignores the error caused ' by attempting to add a duplicate key to the collection. On Error Resume Next For Each Cell In AllCells NoDupes.Add Cell.Value, CStr(Cell.Value) ' Note: the 2nd argument (key) for the Add method must be a string Next Cell ' Resume normal error handling On Error GoTo 0 ' Add the sorted, non-duplicated items to a ListBox For Each Value In NoDupes On Error Resume Next UserForm3.ListBox1.AddItem Value Next Value ' Show the UserForm UserForm3.Show End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HELP!!! TIME SENSITIVE | Excel Worksheet Functions | |||
Time sensitive please help.. | Excel Programming | |||
time sensitive file? | Excel Programming | |||
Time Sensitive Formulas | Excel Discussion (Misc queries) | |||
Time Sensitive - Stacked Cluster Columns | Charts and Charting in Excel |