Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP!!! TIME SENSITIVE Walt Excel Worksheet Functions 5 September 22nd 08 07:25 PM
Time sensitive please help.. Ewing25 Excel Programming 1 April 30th 08 01:24 PM
time sensitive file? mepetey Excel Programming 9 September 5th 07 10:48 AM
Time Sensitive Formulas gregg Excel Discussion (Misc queries) 0 April 6th 06 03:45 AM
Time Sensitive - Stacked Cluster Columns tlarson475 Charts and Charting in Excel 1 February 23rd 06 03:00 PM


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"