+ Reply to Thread
Results 1 to 3 of 3

Bring data from another workbook to current workbook if two criteria met

  1. #1
    Registered User
    Join Date
    02-08-2014
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    60

    Bring data from another workbook to current workbook if two criteria met

    Hello,

    I have a file "vlookup to" that has four columns:

    PAYOR (populated)
    DATE OF SERVICE (populated)
    CPT CODE (populated)
    RATE (need to get from "vlookup from" workbook)

    I have a file "vlookup from" that has four sheets, each sheet has two columns in the data table:

    CPT CODE (populated)
    RATE (populated)

    In cells B2 of each sheet is an "Effective" date
    In cells B3 of each sheet is an "End" date

    The data tables are named using the folowing methodology:
    PAYOR&"Rates"&YYYY

    What I want to do is look up both the PAYOR and the DATE OF SERVICE from the "vlookup to" file, find the appropriate sheet in the "vlookup from" file and then bring in the rate for the CPT CODE to the "vlookup to" "RATE" column.

    For example, in row 2 of the "vlookup to" file, the row reads:
    PAYOR Date of Service CPT CODE RATE
    BX 2/16/2014 10021 needed

    The macro should then go to the "vlookup from" file, find the "BXRates2014" table and vlookup the CPT CODE "10021" and return the rate of $2.00 to the "RATE" column in the "vlookup to" file.

    Similarily, in row 18 of the "vlookup to" file, the macro should go to the "vlookup from" file, find the "HNRates2014" table and vlookup the CPT CODE "86485" and return the rate of $1.50 to the "RATE" column in the "vlookup to" file.

    Any help or guidance would be greatly appreciated. Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Bring data from another workbook to current workbook if two criteria met

    Hi shawnvon,

    Here is code you can run from the "vlookup to" file I think does what you are asking. It assumes the "vlookup from" file is in the same directory.

    Please Login or Register  to view this content.
    Hope that helps,

    Dan
    Last edited by djbomaha; 05-08-2016 at 04:56 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Bring data from another workbook to current workbook if two criteria met

    Hi Shawnvon,

    Give this a try in D2:

    Please Login or Register  to view this content.
    Hope it works for you.

+ 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] Get data from Closed workbook and paste in current Workbook
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-08-2015, 02:45 PM
  2. VBA code to copy data from current workbook to another workbook and send email
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-05-2015, 06:47 AM
  3. Can I have Excel search another workbook for data and import it to my current workbook?
    By mgruber in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 09-05-2014, 07:13 PM
  4. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  5. [SOLVED] Copying data from external workbook into current workbook based on cell value
    By Brontosaurus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-07-2012, 11:17 AM
  6. Filter data on seperate workbook and paste on current workbook
    By ZeDoctor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2012, 08:08 AM
  7. Loop through data on a workbook, selected it and paste in current workbook
    By concatch in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2012, 08:59 AM

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