+ Reply to Thread
Results 1 to 9 of 9

Macro to Lookup and Output to new sheet

  1. #1
    Registered User
    Join Date
    07-24-2008
    Location
    London
    Posts
    43

    Macro to Lookup and Output to new sheet

    Hi,

    I have a number of headings in column 5 which have data below them. I want a Macro which will take the 'ID' and 'Name' from Sheet 1 and compare it against the 'ID' and 'Full Name' from Sheet 2 displaying the following output in Sheet3:

    - ID (Column A) and Name (Column B) from Sheet1
    - In Column 3 I am expecting the following 3 results:
    - ID does not exist in Sheet2
    - Match (When the ID exists in Sheet 2 and the corresponding Names match)
    - Does not Match (When the ID exists however the 'Full Name' in Sheet2 does not match the Name from Sheet1.

    I have attached a sample copy of what I am expecting.
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to Lookup and Output to new sheet

    Hi,

    You don't need a macro, (unless you also want the macro to extract the sheet 1 IDs and names from sheet1 to the Output sheet). Just put the following in D3 on the Output sheet and copy down.

    Please Login or Register  to view this content.
    HTH
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-30-2010
    Location
    Kuala Lumpur,Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro to Lookup and Output to new sheet

    Why are you posting in the thread of another member?

    Please read the rules and start your own thread.

    I am removing the attachment

    Rgds

    Hi there,

    I am the beginner and have this table of database. I need to use the Code, Type and Service, so the output will be the one coresponded to those three arguments. E.g.

    Code: AA1234
    Type: A736
    Service: 1M

    -> Output: 184

    May I know the default function that I can use in excel and/or UDF in vba so I would able to enter the arguments to get the output i.e. =Quantity(AA1234,A736,1M). Output = 184

    I had used combination of vlookup() and match() but i think it can only have one header whereas mine is two.

    Attached the table. Thanks.
    Last edited by Richard Buttrey; 08-30-2010 at 04:54 AM. Reason: breach of rules

  4. #4
    Registered User
    Join Date
    07-24-2008
    Location
    London
    Posts
    43

    Re: Macro to Lookup and Output to new sheet

    I wasn't aware I was posting into a thread of another member.

    I do want the Macro to extract the ID and Names from Sheet1. Macro would be far easier than doing the copy down since I have to do this task once every day.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to Lookup and Output to new sheet

    Sorry Ray,

    I saw the details were different to the original request and incorrectly assumed it was someone else posting.

    However the details are different to your original question so it would be better as a new thread.

    Regards

  6. #6
    Registered User
    Join Date
    07-24-2008
    Location
    London
    Posts
    43

    Re: Macro to Lookup and Output to new sheet

    Thanks for clarifying. Would it be easy to convert your solution into a Macro? Has an sample attachment been added which has now been removed?

  7. #7
    Registered User
    Join Date
    08-30-2010
    Location
    Kuala Lumpur,Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro to Lookup and Output to new sheet

    Sorry I just joined and assume it is similar case so can just post it here . Okay thanks for the reminder. I shall start my own thread then.

  8. #8
    Registered User
    Join Date
    07-24-2008
    Location
    London
    Posts
    43

    Re: Macro to Lookup and Output to new sheet

    Ok well I am still waiting for a solution so you could keep checking this thread to see if the fix works for you too.

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro to Lookup and Output to new sheet

    Hi,

    Does the formula I originally gave not work?

    If you want this automated just get a macro to populate column C of the Output sheet with the formula.

    Rgds

+ 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