removing dups in a single field using switch?
I have a list of data and columns c,d, and e have all unique data. however some companies have more than one entry, and their name appears sometimes 8 times. I want to eliminate all but the topmost company name from t he dups. I'm assuming I need a switch statement, but I'm not sure. any ideas?
Re: removing dups in a single field using switch?
you just want to remove their name from the cell, but not the whole row?
can you attach a sample sheet?
pete
1 Attachment(s)
Re: removing dups in a single field using switch?
didn't realize uploading was enabled....sweeeeet.
here's an example; i've highlighted in red what I mean should be deleted. I recenty figured out that a Switch statement is actually called Select in VB.
Re: removing dups in a single field using switch?
this code does not search the whole sheet for duplicates, only if they are grouped together
VB Code:
Sub test()
Dim mystr As String, i As Integer
mystr = Cells(1, 2)
For i = 2 To Sheet1.UsedRange.Rows.Count
If Cells(i, 2) = mystr Then Cells(i, 2) = ""
If Not Cells(i, 2) = "" Then mystr = Cells(i, 2)
Next
End Sub