Time sensitive please help!

E

Ewing25

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
 
R

Robin Hammond

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top