Thread: No dupes
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ivyleaf Ivyleaf is offline
external usenet poster
 
Posts: 141
Default No dupes

On Apr 5, 2:45*am, Eric wrote:
I am trying to get a list box to run in form6. *I am going over 2000 rows of
information and I don't want the mix types duplicated. *I want to have the no
dupes run on Column B26 to B2500. *I am using this macro and when it runs I
get an error 70 *"Permission denied". *I would appreciate it if someone could
help....Thank you in advance.

Here is the macro:

Sub startLast4()

sheets("test database").unprotect ~~~ this is where the information is in
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *Column B
*Dim allcells As Range, cell As Range
Dim nodupes As New Collection

On Error Resume Next
* * For Each cell In Range("B27:B2500")
* * * * nodupes.Add cell.Value, CStr(cell.Value)
* * Next cell
* * On Error GoTo 0

* * For Each Item In nodupes
* * * * UserForm6.ListBox1.AddItem Item
* * Next Item

* UserForm6.Show

* End Sub

Eric


Hi Eric,

What line gives you that error?

Cheers,
Ivan.