+ Reply to Thread
Results 1 to 5 of 5

VBA Code for matching cell data in the column and taking nearby cell data

  1. #1
    Forum Contributor
    Join Date
    11-24-2019
    Location
    India
    MS-Off Ver
    Ms. Office 2016
    Posts
    169

    Exclamation VBA Code for matching cell data in the column and taking nearby cell data

    Hello,
    I have two files, file 1 and file 2. In both the files data are different except name of the employees. I want to match name of the employees in both the files and extract score of that employee in the next column so that score of that employee will be exactly next to that employee name (as given in result file). For better understanding sample files are attached. Please provide VBA code. Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: VBA Code for matching cell data in the column and taking nearby cell data

    Do you want the desired result from File 1 and File 2 in a new third file?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Forum Contributor
    Join Date
    11-24-2019
    Location
    India
    MS-Off Ver
    Ms. Office 2016
    Posts
    169
    Quote Originally Posted by Mumps1 View Post
    Do you want the desired result from File 1 and File 2 in a new third file?
    Anything, it will be fine even if result will be in the new sheet or in new file.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: VBA Code for matching cell data in the column and taking nearby cell data

    Make sure that both files are open. Place this macro in File2. Change the file name (in red) and sheet names (in blue) to suit your needs. Run the macro.
    Please Login or Register  to view this content.
    b

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA Code for matching cell data in the column and taking nearby cell data

    If both files are open...
    Place this code in File 2 and run...
    Please Login or Register  to view this content.
    If variable row
    Please Login or Register  to view this content.
    Last edited by sintek; 08-09-2021 at 03:45 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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. [SOLVED] Find Spans in column and return value in nearby cell
    By vulk in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-14-2020, 08:52 PM
  2. Replies: 4
    Last Post: 02-02-2019, 04:05 PM
  3. Vba code when cell in range returns a certain value, enter formula in nearby cell
    By dsrt16 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-06-2018, 08:16 AM
  4. [SOLVED] Find matching data, copy data in adjacent cell and paste in new column
    By Bikeman in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-23-2015, 04:08 PM
  5. Priavte sub to move chart nearby active cell in column B
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2014, 04:45 PM
  6. Replies: 1
    Last Post: 10-25-2011, 07:43 AM
  7. taking data at end of column and sending it to cell in another workbook
    By gdecat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2005, 02:22 PM

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