+ Reply to Thread
Results 1 to 6 of 6

Disable lookup autofill

  1. #1
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Disable lookup autofill

    Hi

    This may sound weird.

    I have a lookup table, using which I lookup user name and populate their location on the main sheet (using VBA code).

    For names missing in the lookup table, I get #N/A, which is expected.

    Next, I loop through all #N/A's on the main sheet, and add their corresponding user names in the lookup table.

    Here, I want to stop my program, and pop up a msgbox to add locations for user names newly added in the lookup table.

    But, as soon as the names are added to lookup table, their locations are updated as 0 on the main sheet.
    I think this happens due to lookups refreshing automatically, and substituting missing locations with zero's. (Remember, user has not yet got a chance to update these lissing locations in lookup)

    Is there a way to stop this lookups refresh until user manually updates loctions and clicks a button?

    I will try to create a sample sheet with this scenario, and upload it later today, but meanwhile, if anyone has any solution, I will appreciate it very much.

    tia
    Ajay
    Attached Files Attached Files
    Last edited by ajaykgarg; 07-02-2010 at 03:29 AM. Reason: Adding sample sheet to demonstrate problem

  2. #2
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Disable lookup autofill

    Added sample sheet

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Disable lookup autofill

    Hi Ajay;
    I think that the only way that you can prevent the refresh is to set calculation to manual.
    I don't think that is a good idea. If you turn automatic calculation off and the user doesn't put something into N8 (which presumably would set calculation back to automatic), then calculation is still set to manual.
    I think this is a better solution.
    Please Login or Register  to view this content.
    Or you could change the formula in B5 to
    Please Login or Register  to view this content.
    If you go this route and have a Huge list, you might do this
    Please Login or Register  to view this content.
    that way vlookup only executes once so the calculation is faster
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  4. #4
    Forum Contributor
    Join Date
    03-11-2010
    Location
    India
    MS-Off Ver
    2010
    Posts
    268

    Re: Disable lookup autofill

    Thanks, Foxguy.
    I used a work around wherein I programatically pre-poulate the cell B5 with text "#N/A" so that it doesn't default to zero after I add "D" to lookup table.

    I know the solution is as weird as the problem, but It works for me.

    Thanks very much
    Ajay
    Last edited by ajaykgarg; 07-02-2010 at 03:30 AM.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Disable lookup autofill

    It's only a matter of:

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: Disable lookup autofill

    Hi snb;
    Quote Originally Posted by snb View Post
    It's only a matter of:

    Please Login or Register  to view this content.
    You're right. I completely forgot about this, and it could easily be a better solution than mine.

+ 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