+ Reply to Thread
Results 1 to 6 of 6

Macro works but I know there is a better way...

  1. #1
    Registered User
    Join Date
    08-15-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    17

    Macro works but I know there is a better way...

    Simply put I needed a macro to check a set of data for duplicate records (via a unique id) and then concatenate all unique column items into one row -- all of the rows have the same column headers, just maybe different data in each row for a given column.

    Here is what I came up with:

    Please Login or Register  to view this content.
    The problem is that column C, D, and E are dates and I keep getting ##### as one of the concatenates. I know it is a format issue, but I don't know how to solve it.

    If you know of a better way or how to 'fix' this code, I would definitely appreciate the help

    -Pwyller

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro works but I know there is a better way...

    What happens when you format them to date? Are concatenates dates separated by something?

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro works but I know there is a better way...

    Can you upload the workbook with the expected output?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Registered User
    Join Date
    08-15-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Macro works but I know there is a better way...

    sample.xlsm

    Took a minute to sanitize the data... Run the macro (go button) and it will created the Combined tab...

  5. #5
    Registered User
    Join Date
    08-15-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    17

    Re: Macro works but I know there is a better way...

    When I format what to date? The original data is formatted as a date and when I tried
    Please Login or Register  to view this content.
    it threw an error...

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Macro works but I know there is a better way...

    See if this will work


    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1