Thread: No dupes
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default No dupes

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