+ Reply to Thread
Results 1 to 4 of 4

INDIRECT function within VLOOKUP to avoid #REF error???

  1. #1
    Registered User
    Join Date
    04-24-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    22

    INDIRECT function within VLOOKUP to avoid #REF error???

    Hi,

    Any help with this would be much appreciated.

    I have a workbook that contains the formula below:
    =IF(A2<>"",VLOOKUP(A2,'All Steps'!A:AH,34,FALSE),"")

    The "All Steps" worksheet data needs to be updated regularly and is currently copied and pasted from another workbook. However, the amount of data contained in this worksheet is huge so to reduce the file size I'm using a macro to copy/paste special (values) the returned VLOOKUP results into another worksheet and then clearing the All Steps data.

    The amount of data now contained with the All Steps worksheet is now so great that it is causing my PC to freeze for an age at a time whilst I copy / paste it from the original document into my workbook (even when pasting values only) and sometimes it's causing the application to crash depending on what other applications I have open at the time.

    I noticed that if I moved the worksheet tab from the original document into my workbook it transfers significantly quicker but once I delete the sheet afterwards it causes all the VLOOKUP formulas to contain the #REF error rather than the worksheet lookup reference.

    Is it possible to retain the worksheet reference using the INDIRECT function nested within the VLOOKUP and force excel to lookup the data when the worksheet is moved across and not if the worksheet is deleted; and if so, could someone show amend the function above as an example (I've no experience of using INDIRECT before)?

    Alternatively, if I'm over complicating this and there is a quick way to copy the huge amount of data over (it's about 13Meg without formatting) Could someone explain me how to do this?

    Thanks,
    Matt

  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: INDIRECT function within VLOOKUP to avoid #REF error???

    Hi,

    Have you tried putting the system into manual calculation mode and switching off screen updating as the first step in your macro, and then putting automatic calc back on at the end?

    If this is no better then upload a representative sample of your workbook and the data you're copying. We don't need the all singing all dancing version with your thousands of rows, just a hundred or so will suffice.
    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
    12-15-2010
    Location
    Greenville, South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    60

    Re: INDIRECT function within VLOOKUP to avoid #REF error???

    The Indirect function to edit your code would be.

    Please Login or Register  to view this content.
    As long as the sheet is in the current workbook this will work. Indrect functions will only work on workbooks that are open unless you get the addin to allow otherwise. I was a little confused on exactly what you were asking but figured I would try and help you out atleast a little bit.

  4. #4
    Registered User
    Join Date
    04-24-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    22

    Re: INDIRECT function within VLOOKUP to avoid #REF error???

    Cheers for your replies people but realised I was over complicating things for myself.

    By removing the formatting from the source document before Copying, rather than Copy / Paste Special. The amount of time it takes to transfer the data is dramatically reduced so I'll live with it as is rather than trying to re-invent the wheel!

    Thanks again,
    Matt

+ 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