+ Reply to Thread
Results 1 to 4 of 4

AUTO/MANUAL Calculation mode marker ?

Hybrid View

KomicJ AUTO/MANUAL Calculation mode... 09-21-2020, 11:09 PM
AlphaFrog Re: AUTO/MANUAL Calculation... 09-22-2020, 12:41 AM
KomicJ Re: AUTO/MANUAL Calculation... 09-22-2020, 01:55 AM
KomicJ Re: AUTO/MANUAL Calculation... 09-22-2020, 02:49 AM
  1. #1
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    AUTO/MANUAL Calculation mode marker ?

    Hey everyone,

    Long story short, I'm currently working on a project that necessitates constant switch between AUTO and MANUAL calculation mode (used to speed up data collecting on the web). And it works great for the most part, except when we have to stop a procedure midway through, since it only reverts back to AUTO calculation at the very end of the code. Personally, I'm fine with it, I just switch it back to AUTO by pressing a button on our sheets...but that's the kind of thing my partner easily forget.

    So I'm trying to add a marker that would show what the current calculation mode is set on to all our pages' headers (which relatively look all the same). When Calculation mode is automatic, have "AUTO" displayed in cells on various sheets. When Calculation mode is manual, have "MANUAL" displayed in the same cells.

    I'm just not entirely sure how to write it. For one, I've never wrote any VBA that's not activated by a button. I'm guessing somekind of OnEvent in the ThisWorkbook tab...but I took a look at the list in the second box and couldn't see anything that would initiate the procedure on an Application.Calculation change. Or maybe I'm just not thinking about it the right way at all.

    Any gentle soul have something to get me started ?
    The somewhat VBA-newbie in me would be very grateful.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,651

    Re: AUTO/MANUAL Calculation mode marker ?

    Whenever you change the calculation mode in your code, include a line that displays the mode in a cell e.g.

    Application.Calculation = xlCalculationManual
    Range("A1").Value = "Manual"
    Application.Calculation = xlCalculationAutomatic
    Range("A1").Value = "Automatic"
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    Re: AUTO/MANUAL Calculation mode marker ?

    Quote Originally Posted by AlphaFrog View Post
    Whenever you change the calculation mode in your code, include a line that displays the mode in a cell e.g.

    Application.Calculation = xlCalculationManual
    Range("A1").Value = "Manual"
    Application.Calculation = xlCalculationAutomatic
    Range("A1").Value = "Automatic"
    Yeah, I thought about that.

    I do have an hidden sheet where I write/store many different things like that using VBA (like last refresh time for example). I then use a simple = formula in the cells I want the info to be displayed in, that refers to that unique cell on my hidden sheet. But I was hesitant to go that route, as it seemed a bit sketchy to rely on formulas for an AUTO/MANUAL calculation marker, and wanted to avoid using the VBA to Range("").Value to write on 20 different sheets or so. Plus, thought I could maybe learn a new trick.

    So do I have to assume that this can't be done via an OnEvent procedure ? If so, I'll probably go with what you suggested.

  4. #4
    Forum Contributor
    Join Date
    08-28-2015
    Location
    Montreal, Canada
    MS-Off Ver
    2013 on PC, 2011 on MAC
    Posts
    159

    Re: AUTO/MANUAL Calculation mode marker ?

    Applied your suggestion...seems to work like a charm.

    I've set it to write "Manual" on my Hidden page before the Application.Calculation = xlManual. That way, all the formulas on my other page have the chance to adjust before it switches to manual.

    Sheets("HIDDEN").Range("F6").Value = "MANUAL"
      Application.Calculation = xlManual
    Then, set it the other way around for automatic.

    Application.Calculation = xlAutomatic
      Sheets("HIDDEN").Range("F6").Value = "AUTOMATIC"
    Looks like all the pages are reacting well to the change, which was what worried me.

    Lockin' this now.
    Thanks for your input, consider yourself rep'd.

+ 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] Chart macro for manual calculation mode
    By Sekars in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-19-2016, 02:17 AM
  2. manual calculation for one worksheet by F9 and auto calculation for other sheet
    By rayshimadri in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-22-2013, 06:16 AM
  3. force excel default settings to manual calculation mode
    By thosecars82 in forum Excel General
    Replies: 4
    Last Post: 12-27-2012, 07:34 AM
  4. Replies: 5
    Last Post: 08-14-2012, 01:31 PM
  5. Replies: 7
    Last Post: 07-09-2012, 05:42 AM
  6. Open CSV causes calculation in manual calc mode
    By kunkletown@comcast.net in forum Excel General
    Replies: 0
    Last Post: 07-25-2006, 04:30 PM
  7. My Calculation Mode Changed to Manual Somehow?!?
    By Jeb in forum Excel General
    Replies: 2
    Last Post: 08-04-2005, 11:05 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