+ Reply to Thread
Results 1 to 10 of 10

Excel Macro (vlookup)?

  1. #1
    Registered User
    Join Date
    12-01-2011
    Location
    Fairfield, OH
    MS-Off Ver
    Excel 2010
    Posts
    10

    Unhappy Excel Macro (vlookup)?

    Help! I need help VBA code to complete the following.

    1.) Take sheet1 / column A value
    2.) Lookup in sheet2 / column A
    3.) Take sheet2 / column B value of lookup match
    4.) Populate sheet1 / column B with sheet2 / column B value
    5.) Complete steps 1:4 for all rows with values on sheet1 / column A

    macro.jpg

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Excel Macro (vlookup)?

    Hi

    Why are you using a macro? What is wrong with just using a VLOOKUP formula?

    rylo

  3. #3
    Registered User
    Join Date
    12-01-2011
    Location
    Fairfield, OH
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Excel Macro (vlookup)?

    It will part of bigger macro that will allow a user to take his/her sheet and format to a required format for upload to another priduct. I need to ensure user only needs to hit a button and their sheet will be ready fit use.

  4. #4
    Registered User
    Join Date
    12-01-2011
    Location
    Fairfield, OH
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Excel Macro (vlookup)?

    If putting a vlookup into column B for all rows with a value in A gets me the desired result, im ok with that solution too, but would still need help with loop.

  5. #5
    Forum Contributor
    Join Date
    11-14-2009
    Location
    Midwest
    MS-Off Ver
    Excel 2003/2007
    Posts
    103

    Re: Excel Macro (vlookup)?

    A VLOOKUP formula would be super easy. First, name your whole chart on Sheet B something you can work with, for this example, SHEET_B_DATA. Then this goes in B1:
    Please Login or Register  to view this content.
    then drag it down.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Excel Macro (vlookup)?

    Hi

    OK, example file time. One way would be to put in the VLOOKUP formulas, and then convert the results to values.

    rylo

  7. #7
    Registered User
    Join Date
    12-01-2011
    Location
    Fairfield, OH
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Excel Macro (vlookup)?

    Attached you will find my example sheet.

    Here is what I need the MACRO to do:

    1.) take PART_NAME on ORDERS sheet and find matching PART_# on PARTS sheet.
    2.) fill in PART_# on ORDERS sheet for all rows with PART_NAME filled in.


    Your help is appreciated!
    Example.xlsx

  8. #8
    Registered User
    Join Date
    12-01-2011
    Location
    Fairfield, OH
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Excel Macro (vlookup)?

    No help???

  9. #9
    Registered User
    Join Date
    12-01-2011
    Location
    Fairfield, OH
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Excel Macro (vlookup)?

    Nevermind.

  10. #10
    Forum Contributor
    Join Date
    11-14-2009
    Location
    Midwest
    MS-Off Ver
    Excel 2003/2007
    Posts
    103

    Re: Excel Macro (vlookup)?

    Sorry about not responding, I haven't been on the forum in a while. A VLOOKUP works great for what you want to do. The data you are looking up has to be a named range with the lookup value at the far left, which yours is. Attachment 135636

+ 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