Hi,

Try this macro.

Sub kTest()
    
    Dim k, i As Long, s As String, Flg As Boolean
    Dim x, r As Range, txt As String
    
    Set r = Range("a2:a" & Range("a" & Rows.Count).End(3).Row)
    k = r
    With CreateObject("scripting.dictionary")
        .comparemode = 1
        For i = 1 To UBound(k, 1)
            k(i, 1) = Replace(k(i, 1), Chr(160), vbNullString)
            If Len(Trim$(k(i, 1))) Then
                If IsNumeric(Trim$(k(i, 1))) Then
                    .Item(s) = .Item(s) + 1
                ElseIf IsDate(Trim$(k(i, 1))) Then
                    txt = txt & ",a" & i
                    If Len(txt) > 245 Then
                        r.Range(CStr(Mid$(txt, 2))).ClearContents
                        txt = vbNullString
                    End If
                Else
                    If Not .exists(Trim$(k(i, 1))) Then
                        s = Trim$(k(i, 1))
                        .Add s, 0
                    Else: s = Trim$(k(i, 1))
                    End If
                End If
            End If
        Next
        x = Array(.keys, .items)
        If Len(txt) > 1 Then
            r.Range(Mid$(txt, 2)).ClearContents
        End If
        On Error Resume Next
        r.SpecialCells(4).EntireRow.Delete
        On Error GoTo 0
        [j2].Resize(.Count, 2) = Application.Transpose(x)
    End With
    
End Sub


Kris

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to