![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Jan 2007
Posts: 208
|
Is there any way that I can change a constant in VBA
Option Explicit Const MaxAccuracy = 0.00001 Const MaxLoops = 100 Constant Reset = 900 I want to be able to change the Reset constant to 900 or 3600. The variable is called over 20 times within the code so if possible I would rather use the Option Explicit rather than make all of the entries using Public Function for each area of the module. Any help would be greatly appreciated - thanks edvwvw |
|
|
|
|
|
#2 |
|
Join Date: Jan 2007
Location: Hyrule
Posts: 3,978
|
If you have a value that you want to change throughout the code, why don’t you just declare it as a variable rather than a constant?
FYI – Option Explicit just forces all variables and constants to be declared. It has no bearing on where or how they are defined.
__________________
Work fascinates me........I could sit and watch it for hours! |
|
|
|
|
|
#3 |
|
Join Date: Jan 2007
Posts: 208
|
Thanks - I will try that instead
edvwvw |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|