+ Reply to Thread
Results 1 to 6 of 6

After a VBA sub, #VALUE! will show in cells with formula

  1. #1
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    After a VBA sub, #VALUE! will show in cells with formula

    But if I edit manually those cells manually just with F2 + ENTER, without modifying anything, then #VALUE! will go away and the proper value will appear.

    Is there an instruction that I could use to prevent this to happen?

    There is no error in the function. And the sub doesn't refer to the cell with the function.

    Please Login or Register  to view this content.
    The sub retrieves the lead time which I place in a separate cell $B$8. Then the function above uses this cell as the LT1 input value.
    Last edited by Saintor; 09-13-2019 at 10:42 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: After a VBA sub, #VALUE! will show in cells with formula

    You may have to provide more information.

  3. #3
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Re: After a VBA sub, #VALUE! will show in cells with formula

    After CTRL+ALT+F9 or if I use in the debug window Application.CalculateFull, it refreshes itself correcty.

    Adding instruction Application.CalculateFull in the code after retrieving the variable doesn't work.
    Last edited by Saintor; 09-13-2019 at 11:21 AM.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: After a VBA sub, #VALUE! will show in cells with formula

    What's the sub?
    Rory

  5. #5
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Re: After a VBA sub, #VALUE! will show in cells with formula

    It is just to retrieve some data form a SQL server via ADO. The formula goes crazy right after

    ActiveCell.Offset(3, 0) = rst!LeadTime
    I made sure that the format of the cell is number.

  6. #6
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    60

    Re: After a VBA sub, #VALUE! will show in cells with formula

    I finally removed the formula tied to cells and used only VBA to calculated their value.

+ 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. Division Formula cells show error when cells its based on are 0
    By varxtis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2019, 05:41 PM
  2. [SOLVED] formula not to show 0 in cells when dragging existing formula
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-14-2018, 12:32 PM
  3. After a formula to show certain cells based on what is in other cells
    By Onleme in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-28-2018, 11:13 PM
  4. Replies: 3
    Last Post: 10-19-2016, 08:43 AM
  5. Formula to show percentage of cells in each segment in custom formatted cells
    By newbie_Lau in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-03-2016, 01:21 PM
  6. Replies: 1
    Last Post: 05-27-2015, 05:00 PM
  7. [SOLVED] How to show formula in cells which are using reference cells
    By lubbamkt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2014, 08:13 AM

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