+ 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
    39

    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
    MS 365
    Posts
    13,474

    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
    39

    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
    729

    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
    39

    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
    729

    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
    729

    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
    39

    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
    729

    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
    39

    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
    729

    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
    39

    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
    729

    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)

Similar Threads

  1. Replies: 2
    Last Post: 09-25-2018, 02:58 AM
  2. [SOLVED] Compare Data in 2 Columns in 2 sheet When there is a match transfer data from 2nd Column
    By kellyjo7 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2015, 01:05 PM
  3. Replies: 1
    Last Post: 02-13-2015, 04:57 PM
  4. Replies: 2
    Last Post: 04-19-2014, 10:06 PM
  5. [SOLVED] Extract data from third column where data in two other columns match
    By redimp in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-16-2014, 10:01 AM
  6. Replies: 9
    Last Post: 07-22-2012, 12:03 PM
  7. [SOLVED] Match cells in Column A, then transpose (matching) row data from column B, C, D, etc.
    By Jahoker in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-15-2012, 10:37 AM

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