Link to home
Start Free TrialLog in
Avatar of ltdanp22
ltdanp22Flag for United States of America

asked on

On/Off switch for VBA code

Simple question for everyone...

In C++, I used to use #define to switch code on and off as follows:

#define DUMMY

#ifdef DUMMY
some code here...
#endif

If I commented out "#define DUMMY", the compiler would ignore all the code between #ifdef and #endif.

Is there anything in VBA that I can use to switch code blocks on and off like this?

Dan
ASKER CERTIFIED SOLUTION
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ltdanp22

ASKER

Thanks! What does the # symbol do?
Avatar of nffvrxqgrcfqvvc
nffvrxqgrcfqvvc

It's a conditional compilation prefix statement used in VB which should work in VBA. #Define  in VB = Const but for conditional compilation use #Const.