+ Reply to Thread
Results 1 to 5 of 5

lookup macro help

Hybrid View

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    Jersey City, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    8

    lookup macro help

    I'm having some major problems with this one mainly because I have little no experience with VBA. I already have a spreadsheet open where I need to place the information. What I need to do is create a macro that will lookup information from a table in another workbook and then place it my original spreadsheet. Another problem is that I need this macro to serve as a uniform macro that will apply to many other similar spreadsheets. The master spreadsheets are similar in that the text title in the cell of the column in which the information needs to be placed is always the same, but the exact location of this column is not always the same. I have tried recording the macro and using a V-Lookup to place the information in the column and I figured I would adjust it later to select the specific cell I’m looking for. It seems like once something is created that will search for the cell I need and make it the active cell I can just use the offset function to place the formula where I need to. My request may be too vague and tough to understand but I'm looking for any kind of help that I can get. Thanks.

  2. #2
    Registered User
    Join Date
    06-11-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: lookup macro help

    It is Better if u attach some sample file that contains the workbook name & worksheet name & data helping us in working out.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,243

    Re: lookup macro help

    Not sure that I really understand your requirement.

    However, have a look at this thread:

    http://www.excelforum.com/excel-prog...e-by-line.html

    It's actually nothing to do with what you are trying to do. However, it demonstrates how to loop through a list (of names, in this instance) and create new sheets from a template for each name and populates the fields on each sheet. What may be useful to you is that it also loops through the cell addresses which are on the source sheet.

    So, you could set up a list of workbooks and indicate source and target addresses, perhaps on separate rows. You could use VLOOKUP to find the file name and then use the definitions to determine which fields get copied where.

    Other than that, you're probably going to need to post some sample workbooks with a detailed explanation of what you need to achieve.

    So, it's doable ...


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    05-31-2012
    Location
    Jersey City, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: lookup macro help

    Thanks, I can't upload any samples right now but I'll be sure to do it later today.

  5. #5
    Registered User
    Join Date
    05-31-2012
    Location
    Jersey City, New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: lookup macro help

    Actually I'm able to put up an example now if anyone wouldn't mind taking a look. The spreading sheet "working copy" is the master spreadsheet that I need to populate with the data. I need to pull the data from the spreadsheet "rate guide."

    First off in the code I need to filter column J where it says "origin country" so that it only shows the United States.
    Then, I need to populate column P where it says "assigned origin port" from column F in the rate guide spreadsheet.
    Information from column G in the rate guide needs to go in column Q of the master spreadsheet.
    Info from column L in the rate guide needs to go in column BA of the master spreadsheet.
    And lastly info from column I of the rate guide needs to go in column BG of the master spreadsheet.

    I've been trying to use VLOOKUP to do this and then find a way to have the macro select the active cell based on the name of the cell rather than it's location. This way I can use this macro for other working copy spreadsheets that I need to apply it to.

    I'm sure that if anyone is going to help me they will probably have questions so just let me know and I'll respond quickly

    Working Copy.xlsx Rate Guide.xlsx

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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