+ Reply to Thread
Results 1 to 13 of 13

VBA: Match 2nd row data with below cells one by one with its column data

  1. #1
    Registered User
    Join Date
    12-27-2018
    Location
    London, England
    MS-Off Ver
    2007, 2010
    Posts
    22

    VBA: Match 2nd row data with below cells one by one with its column data

    In Workbook "Sheeta" match 2nd-row cell data with below cells in same column one by one and show the result in "Result(After Sheet)".


    If cell data: from row 2 matches below cell data: keep the value/data in bracket
    If cell data: from row 2 mismatches below cell data: concatenate value/data with double semicolon like this "(ay::xy)"

    The original data range is different. Shown in image rows from 1 to 6.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by vikim; 01-14-2019 at 06:38 AM. Reason: Correction

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    XL 2010,2016
    Posts
    11,736

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    12-27-2018
    Location
    London, England
    MS-Off Ver
    2007, 2010
    Posts
    22

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    File attached.

  4. #4
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    699

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    i dont understand your logic still, but In General Logic try below code
    Please Login or Register  to view this content.
    Regards,
    MohanS


    "Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

    You can simply say thanks by clicking "*Add Reputation" icon

  5. #5
    Registered User
    Join Date
    12-27-2018
    Location
    London, England
    MS-Off Ver
    2007, 2010
    Posts
    22

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    Let me try...

    If cell data: from row 2 matches below cell data: keep the value/data in bracket
    If cell data: from row 2 mismatches below cell data: concatenate value/data with double semicolon like this "(ay::xy)"

    The original data range is different. Shown in image rows from 1 to 6.
    Ignore sheeta row...because its only sheet name.
    Last edited by vikim; 01-14-2019 at 06:44 AM.

  6. #6
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    699

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    now ok

    try below code

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    699

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    This is updated code
    try below code and ignore #6

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-27-2018
    Location
    London, England
    MS-Off Ver
    2007, 2010
    Posts
    22

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    Yes, Thank you. This is what I am looking for.
    But the range is fixed....I need to add more columns till there is data.

  9. #9
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    699

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    But the range is fixed....I need to add more columns till there is data.
    r u try in your original data?

  10. #10
    Registered User
    Join Date
    12-27-2018
    Location
    London, England
    MS-Off Ver
    2007, 2010
    Posts
    22

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    Yup, I am doing that.

  11. #11
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    699

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    ahh
    try below code
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    12-27-2018
    Location
    London, England
    MS-Off Ver
    2007, 2010
    Posts
    22

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    Thank you.

  13. #13
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    699

    Re: VBA: Match 2nd row data with below cells one by one with its column data

    your welcome and thanks for rep

+ 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