Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Adelisa Fischer   on Sep 01 In MS Office Category.

  
Question Answered By: Laurel Collins   on Sep 01

Option Explicit can be put  in automatically by Excel (for new modules).
It's in Tools/Options/Require variable  Declaration.

Never trust global variables  to retain  a value between separate "runs" of
the code while the spreadsheet is open. On occasions, Excel will "reset
your project". Sometimes it warns you and other times it doesn't.

If you want a value to have some permanence, you're better off putting the
value into a cell  - possibly on a hidden sheet.

I will also tend to put calls to an "Initialise" routine into every
subroutine on occasions. The call  checks an "Initialised" Boolean
variable - if that is false, it does the initialisation then sets it to
true.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Public variables Or get search suggestion and latest updates.


Tagged: