Results 1 to 10 of 11

Thread: VBA Macro To Create A New Column Of Unique Values From Another Column Of Duplicates

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Moderator
    Join Date
    Jul 2012
    Posts
    156
    Rep Power
    14
    Try this one
    Code:
    Sub NoDupes()
        Dim sq() As Variant
        With Sheets("Extract ESR")
            sn = .Range("V2:V" & .Cells(Rows.Count, 22).End(xlUp).Row)
        End With
        On Error Resume Next
        With New Collection
            For j = 1 To UBound(sn)
                .Add sn(j, 1), CStr(sn(j, 1))
            Next
            ReDim Preserve sq(.Count)
            For i = 1 To .Count
                sq(i - 1) = .Item(i)
            Next
        End With
        On Error GoTo 0
        Sheets("Extract ESR").Range("W2").Resize(UBound(sq)) = WorksheetFunction.Transpose(sq)
    End Sub

  2. #2
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Rep Power
    0
    Hello,

    I'm trying to understand a little about macro.

    I tried your proposition, but i see that the macro is not running automatically. Do you have any explanation please?

    It should run every time data in column V change.

    Thank you for helping me.

Similar Threads

  1. Replies: 17
    Last Post: 05-22-2013, 11:58 PM
  2. Replies: 6
    Last Post: 05-16-2013, 09:56 AM
  3. Replies: 3
    Last Post: 08-05-2012, 09:16 PM
  4. Macro to create files as per the contents in a column
    By Praveen Bj in forum Excel Help
    Replies: 1
    Last Post: 07-05-2012, 09:07 PM
  5. Lookup Multi-Column For Unique String Combination For Numeric Value Output
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 07-03-2011, 07:23 PM

Tags for this Thread

Posting Permissions

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