+ Reply to Thread
Results 1 to 11 of 11

Combine cell value to one cell based on Row matching

  1. #1
    Registered User
    Join Date
    02-13-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Combine cell value to one cell based on Row matching

    Hi Guys

    I am new to excel programming

    Just trying to understand if there is a way i can combine cells in a column based on a value of a row column

    I am attaching an example data and expected result

    Can someone help please

    Regards

    Harry
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Combine cell value to one cell based on Row matching

    Try the attached
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-13-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Combine cell value to one cell based on Row matching

    Hi Jindon

    This is awesome.... Saved me so much...

    Thank you

    Harry

  4. #4
    Registered User
    Join Date
    02-13-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Combine cell value to one cell based on Row matching

    Hi Jindon

    Thanks for the code but when i use it for the bigger data it gives me error for undefined object

    Also I was getting VBA error 400

    Can you please advise what is the reason..
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Combine cell value to one cell based on Row matching

    I don't get error....


    When you debug, which line was hi-lited?

  6. #6
    Registered User
    Join Date
    02-13-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Combine cell value to one cell based on Row matching

    Here is the line

    txt = Join$(Array(a(i, 1), a(i, 2)), ";;")

    Also get the TYPE mismatch error
    as the data I am using is a little different
    would that make a difference

    and I have 45k rows

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Combine cell value to one cell based on Row matching

    Don't your data have Error value?
    If so, it will raise the error.
    Insert one line
    Please Login or Register  to view this content.
    And Number of rows shouldn't matter.
    Last edited by Cutter; 08-24-2012 at 10:39 AM. Reason: Removed whole post quote

  8. #8
    Registered User
    Join Date
    02-13-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Combine cell value to one cell based on Row matching

    Thanks Jindon
    You are a star...Just a quick questions how I can understand better on this code.... as to how is it working...
    And is there a way to find where the error is in the data
    Regards

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Combine cell value to one cell based on Row matching

    Please Login or Register  to view this content.
    1) Concatenate Col.A & Col.B as a unique key.
    2) If same key found, concatenate Col.D.
    That's all.

  10. #10
    Registered User
    Join Date
    02-13-2012
    Location
    australia
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Combine cell value to one cell based on Row matching

    Thanks Jindon
    I will test this ...
    What if I have to increase the number of columns to match. Where do I make changes in ARRAYS

    Regards

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Combine cell value to one cell based on Row matching

    For unique identifier?
    This is the line.
    Add the col.ref like ,a(i,3)
    3 for col.C in your case.
    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)

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