+ Reply to Thread
Results 1 to 2 of 2

Thread: Run a macro to copy a row in another worksheet

  1. #1
    Registered User
    Join Date
    03-24-2011
    Location
    Fort Wayne, IN
    MS-Off Ver
    Excel 2007
    Posts
    12

    Run a macro to copy a row in another worksheet

    Hello!
    I would like to come up with a macro that while you are typing a company name in one cell, it will automically look in another worksheet and copy the entire row..which has the address, company, contact and so on.
    See example below..


    Worksheet 1

    Type: ABC Company (While typing the macro it is running and looking in Worksheet 2 for ABC company)


    Worksheet 2
    ABC Company 7510 Innovation Blvd Irving, TX 45897


    Worksheet 1
    (Find the company and enteres)
    ABC Company
    7510 Innovation Blvd
    Irving, TX 45897


    and I would like it to go up and down instead of side to side in the a row.

    Is this possible?
    Thank you !!

  2. #2
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,226

    Re: Run a macro to copy a row in another worksheet

    No macro needed for this. The VLOOKUP() formula will bring over the matching row data for you. Read up on VLOOKUP().

    If you typed a company name in A1, then the formulas might be:

    A2: =VLOOKUP($A$1, Sheet2!$A:$Z, 2, 0)
    A3: =VLOOKUP($A$1, Sheet2!$A:$Z, 3, 0)
    A4: =VLOOKUP($A$1, Sheet2!$A:$Z, 4, 0)
    Last edited by JBeaucaire; 01-10-2012 at 01:05 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

+ 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.2.0