+ Reply to Thread
Results 1 to 5 of 5

Save a Boolean Variable and Recall Later

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    157

    Save a Boolean Variable and Recall Later

    I have a workbook which has a macro that runs when it's open. Currently, it sets the auto complete feature to False, but I want it to check if the value is true or false and then set it to false. Later on the user of the workbook will run a macro and I want that macro to recall the boolean value and set it back to what it was originally. How can I do that?
    Last edited by Ricker090; 08-13-2012 at 03:44 PM. Reason: Solved

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Save a Boolean Variable and Recall Later

    You can always assign the outcome to a single cell somewhere in your workbook and call on its value later.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Save a Boolean Variable and Recall Later

    perhaps using a public variable...

    See links for explanation

    http://www.ozgrid.com/VBA/variable-scope-lifetime.htm
    http://support.microsoft.com/kb/141693
    http://www.cpearson.com/excel/scope.aspx
    Regards,
    Vandan

  4. #4
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Save a Boolean Variable and Recall Later

    The public variable is what I was looking for. I should have known that.... it must be Monday.

  5. #5
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Save a Boolean Variable and Recall Later

    Or the built-in document variable like Subject, Author, etc.

    Workbooks(1).BuiltinDocumentProperties("Subject") = MyValue
    David
    (*) Reputation points appreciated.

+ 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