Consulting

Results 1 to 5 of 5

Thread: Solved: Merging Duplicate

  1. #1
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location

    Question Solved: Merging Duplicate

    I have this VBA Code But like my other problems will not work on 800 000 Row just work till 65536 row .

    Please help me on this also .

    [vba]
    Option Explicit
    Sub Merging_Duplicate()
    Dim a, i As Long, ii As Long, n As Long, z As Long, x As Long
    a = Sheets("Sheet1").Range("a1").CurrentRegion.Value
    n = 1
    With CreateObject("Scripting.Dictionary")
    .CompareMode = 1
    For i = 2 To UBound(a, 1)
    For ii = 1 To 1
    z = z & Chr(2) & a(i, ii)
    Next
    If Not .exists(z) Then
    n = n + 1: .Item(z) = n
    For ii = 1 To UBound(a, 2)
    a(n, ii) = a(i, ii)
    Next
    Else
    x = .Item(z)
    For ii = 2 To UBound(a, 2)
    If a(i, ii) <> "" Then
    a(x, ii) = a(x, ii) & IIf(a(x, ii) <> "", ", ", "") & a(i, ii)
    End If
    Next
    End If
    z = ""
    Next
    End With
    On Error Resume Next
    Application.DisplayAlerts = False
    Sheets("Results").Delete
    On Error Goto 0
    Sheets.Add().Name = "Results"
    With Sheets("Results").Cells(1).Resize(n, UBound(a, 2))
    .Value = a
    End With
    End Sub
    [/vba]
    Last edited by Aussiebear; 04-04-2012 at 03:53 PM. Reason: Corrected the tags surrounding the submitted code

  2. #2
    VBAX Regular
    Joined
    Feb 2012
    Posts
    31
    Location
    And your question is?
    ------------------------------------------------

    Thanks For All Your Help

    Windows 7

    Excel 2010

    Any codes I provide please try on a copy of your workbook first as these cannot be undone!

    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

  3. #3
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location
    Thank you so much , I found the problem , now it is working .

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    And the solution was?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  5. #5
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location
    just i split data on sheet . that mean it work fine on 180 000 Record but when it will be 800 000 it will not work , code work but excel can not work with this QTY of record.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •