+ Reply to Thread
Results 1 to 2 of 2

Macro: open file, read data, create table, vlookup

  1. #1
    Registered User
    Join Date
    05-26-2011
    Location
    Morrisville, NC
    MS-Off Ver
    Excel 2003
    Posts
    2

    Macro: open file, read data, create table, vlookup

    Is there a way in excel to do some semi-automated pattern matching and add a new column as a result? Im sure I can use VLOOKUP for the pattern matching, but how do I create a macro to automate the entire process of opening a existing file, create a vlookup table and inserting the correct vlookup syntax as a new column? Here are some specifics:

    I have two excel files. One contains only two columns and essentially never changes (Masterlist). The second file is a report that is generated daily with different bits of data. However there is one common element between the two files called "SiteID." For each daily report I would like to be able to match the SiteID to the Masterlist and add the second column from the Masterlist to the daily report. Example:

    Here is what I have now...
    Please Login or Register  to view this content.
    Here is what I would like...
    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    05-26-2011
    Location
    Morrisville, NC
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro: open file, read data, create table, vlookup

    This really is a multi-step process that requires a macro. The steps are this:
    (1) Create a new column in "dailyreport"
    (2) label the column
    (3) determine which rows in the column need the lookup function (or at least where to end)
    (4) insert the approprite lookup in the columns from #3

    This works for #1 and #2
    Please Login or Register  to view this content.


    This works for #4:
    Please Login or Register  to view this content.

    The question becomes how to I perform #3 and what needs to be edited in the VLOOKUP for automatic pasting via a macro?
    Thanks!

+ 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