+ Reply to Thread
Results 1 to 4 of 4

Range.Calculate does not update cell value

  1. #1
    Registered User
    Join Date
    08-27-2007
    Location
    Australia
    Posts
    60

    Range.Calculate does not update cell value

    Hi all,

    I have a cell that I put a date into.
    I then make that cell a named range "end_date".

    The formula I am using is =year(end_date).

    If I use VBA to calculate the cell it won't update.

    The only way I can get it to update is click on the cell and press enter.

    Any ideas?

    Thanks

  2. #2
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Range.Calculate does not update cell value

    why not you use sheet range in place of named range in vba
    Please Login or Register  to view this content.
    Kamboj
    _________________________________________________________________________________
    Mark the thread as SOLVED if my answer satisfy you.

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Range.Calculate does not update cell value

    Quote Originally Posted by tejay View Post
    I have a cell that I put a date into. I then make that cell a named range "end_date". The formula I am using is =year(end_date). If I use VBA to calculate the cell it won't update. The only way I can get it to update is click on the cell and press enter. Any ideas?
    Which is "the cell" that won't update: the cell called "end_date", or the cell with the formula =YEAR(end_date)?

    And how so you "use VBA to calculate" the cell?

    Please copy-and-paste the line of code into a response here. Even that might not be sufficient. Please copy-and-paste all relevant lines of code, including declarations and set-up code.

    Finally, what is the calculation mode: Automatic or Manual?

    The subject line suggests that you might be using a statement of the form Range("a1").Calculate. That updates A1 only if: (1) calculation mode is Manual; or (2) calculation mode is Automatic, and A1 or a cell referenced by the formula A1 has been modified.

    If the calculation mode is Automatic, perhaps you should use Range("a1").Dirty. That makes Excel believe A1 has been modified; so it causes A1 and all of its dependent cells (that reference A1) to be recalculated.

  4. #4
    Registered User
    Join Date
    08-27-2007
    Location
    Australia
    Posts
    60

    Re: Range.Calculate does not update cell value

    Hi All,

    Yes it was a manual calculation using range("A1").Calculate

    Kamboj - your solution is perfect, thanks heaps!

    Thanks all

+ 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. [SOLVED] Update Range based on cell value
    By MichaelGG1581 in forum Excel General
    Replies: 3
    Last Post: 10-27-2015, 03:19 PM
  2. Writing new record in a table upon the update of a cell or cell range
    By bpopov007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-08-2014, 02:20 AM
  3. Update range of cell to another workbook
    By tkwei13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2013, 12:10 AM
  4. Last data range cell update
    By Ralem in forum Excel General
    Replies: 8
    Last Post: 12-26-2010, 03:19 PM
  5. Input range only and calculate Average of that range in another cell
    By Kokomo in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-27-2007, 09:35 AM
  6. [SOLVED] Summed Cell won't update as I add data into the cell range...
    By mrmer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2006, 08:45 PM
  7. Replies: 2
    Last Post: 12-16-2005, 02:45 PM

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