View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
L. Howard L. Howard is offline
external usenet poster
 
Posts: 852
Default Find dupes, list in MsgBox with cell.address convert ws widecode to one sheet

On Sunday, May 25, 2014 8:54:41 AM UTC-7, Claus Busch wrote:
Hi Howard,



Am Sun, 25 May 2014 08:40:59 -0700 (PDT) schrieb L. Howard:



Trying to convert this code to sheet 1 only, one column only (col T) and list all dupes in a msgbox with cell.address.




The search item could be for a number or text.




the first match will be ignored. All other matches will be listed:



Sub FindDupes()

Dim LRow As Long, i As Long

Dim myStr As String



With Sheets("Sheet1")

LRow = Cells(Rows.Count, "T").End(xlUp).Row

For i = 1 To LRow

If WorksheetFunction.CountIf(.Range(.Cells(1, "T"), _

.Cells(i, "T")), .Cells(i, "T")) 1 Then

myStr = myStr & .Cells(i, "T").Value & vbTab & _

.Cells(i, "T").Address(0, 0) & Chr(10)

End If

Next

End With

MsgBox myStr

End Sub





Regards

Claus B.

--


Well, that is a pretty good conversion, actually a re-write. Sure seem to me to do the trick. That Function.CountIf part that sorts it all out is always a mystery to me. I can get part way through it and then bog down.

Thanks.
Howard