+ Reply to Thread
Results 1 to 8 of 8

Getting values off another sheet by references!?

  1. #1
    Registered User
    Join Date
    08-05-2014
    Location
    cologne germany
    MS-Off Ver
    2007
    Posts
    4

    Question Getting values off another sheet by references!?

    Hello,

    please have a quick look at my attachment: I need to fill the columns B-D of the sheet "starting data" with the values matching
    the IDs of the sheet "reference". The result should look like shown in sheet "result after code".

    You can also find my somewhat working solution inside (press the arrow), but its performance is too bad, it takes several minutes
    to run on the actual lists wich contain 20,000 - 30,000 rows each, wich is not acceptable.

    Can you guys help me out with a better working solution to my problem?
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Getting values off another sheet by references!?

    Hi and welcome to the forum

    You could use a simple vlookup for this, no VBA needed...

    B2=VLOOKUP($A2,reference!$B$2:$F$11,3,0)
    C2=VLOOKUP($A2,reference!$B$2:$F$11,4,0)
    D2=VLOOKUP($A2,reference!$B$2:$F$11,2,0)&" "&=VLOOKUP($A2,reference!$B$2:$F$11,5,0)

    all copied down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    08-05-2014
    Location
    cologne germany
    MS-Off Ver
    2007
    Posts
    4

    Re: Getting values off another sheet by references!?

    Hello Dibbins thank you for your answer and sorry for the late reply,

    The problem is, I cannot add formulas or anything else manually after starting the code.
    I tryed implementing the vlookup using VBA but it won't let my no matter how hard I try:

    Please Login or Register  to view this content.
    What am I missing??

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Getting values off another sheet by references!?

    Hi bydo,
    try this
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Getting values off another sheet by references!?

    FWIW:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-05-2014
    Location
    cologne germany
    MS-Off Ver
    2007
    Posts
    4

    Re: Getting values off another sheet by references!?

    Hello nilem, hello john,
    thank you for your answers, both codes work perfectly, I prefer john's code because it runs a lot faster!

    If anybody else is using this in the future be aware that john forgot to merge the city and street in the last column,
    a minor error and very easy to fix, you figure.

    I have one last quesion: what exactly is the purpose of the digits in these statements?

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Getting values off another sheet by references!?

    You're welcome. Glad to help out and thanks for the feedback.

    .End(3)(1).Row and .End(3).Row - actually they both mean the same thing. .End(3) you'll more often see as .End(xlUp). The (1) is not necessary I was just in a hurry writing the code. They chose the last row with data in a column.

  8. #8
    Registered User
    Join Date
    08-05-2014
    Location
    cologne germany
    MS-Off Ver
    2007
    Posts
    4

    Re: Getting values off another sheet by references!?

    Thanks again, you helped me a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using variables to populate sheet and cell references in another sheet
    By TLW80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2014, 08:20 PM
  2. VLOOKUP table on one sheet that references every sheet in workbook
    By sportsman56 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2013, 12:22 PM
  3. Pivottable references and values
    By Geoff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2006, 01:10 PM
  4. Replies: 0
    Last Post: 08-25-2005, 02:17 AM
  5. [SOLVED] relative sheet references ala sheet(-1)!B11 so I can copy a sheet.
    By RonMc5 in forum Excel General
    Replies: 9
    Last Post: 02-02-2005, 09:06 PM

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