+ Reply to Thread
Results 1 to 3 of 3

Macro changes vlookup formula. (Should not do so)

  1. #1
    Registered User
    Join Date
    10-16-2013
    Location
    Nederland
    MS-Off Ver
    Excel 2003
    Posts
    38

    Macro changes vlookup formula. (Should not do so)

    Good day all!

    I have this little problem with a macro I'm using.

    In the workbook attached I made an example to make clear what is happening.

    Some info:

    The user only uses the sheet "Overview" and "Insert_macro".
    The user copies a table from a different workbook to the green area in "Insert_macro" every Monday. After clicking the button the macro pastes the table to "Values".
    "Calculation" surprisingly calculates the data from "Values" into the graphs which are directly linked to the ones in "Overview".
    These are used for presentations etc.

    Now, when I run the macro the lookup area in "Calculation", cells B2:D6, changes. However, the area should stay the same because we want to see the last 5 weeks.

    Any Ideas how to fix this?

    With kind regards,

    Psj
    Attached Files Attached Files

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro changes vlookup formula. (Should not do so)

    Hi,

    When you insert new rows, the formulas will adjust to refer to the same actual cells as they were previously looking at and hence the formulas offset by 5 rows. You can fix that by copying the existing values down and then simply pasting the new data in.
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    10-16-2013
    Location
    Nederland
    MS-Off Ver
    Excel 2003
    Posts
    38

    Re: Macro changes vlookup formula. (Should not do so)

    Works great! Thank you

+ 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. Macro for a vlookup formula
    By bhavnas43 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2016, 03:14 AM
  2. MACRO FORMULA:Write FORMULA manually instead of VLOOKUP IN VBA
    By tieyanna in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-20-2015, 10:40 AM
  3. Macro formula:write formula manually instead of vlookup
    By tieyanna in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2015, 08:42 AM
  4. IF formula/vlookup macro
    By rafaruiz123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2014, 01:45 PM
  5. Macro to replace vlookup formula
    By bigband1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2014, 05:31 AM
  6. If ve Vlookup Formula with Macro
    By ofd2008 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2014, 10:23 AM
  7. Plz help me to replace vlookup formula with a macro
    By A100KA in forum Excel General
    Replies: 3
    Last Post: 12-30-2011, 10:05 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