ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What is the #define equivalent? (https://www.excelbanter.com/excel-programming/398101-what-define-equivalent.html)

Sing

What is the #define equivalent?
 
Dear Excel Gurus,

In C, one can make convenient definitions like;
#define ABC 242
#define NAME "James Smith"

In Excel VBA, is there an equivalent for #define?

Thanks.



Bob Phillips

What is the #define equivalent?
 
Const

say

Const ABC as long = 242

Const NAME as string = "James Smith"

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Sing" wrote in message
...
Dear Excel Gurus,

In C, one can make convenient definitions like;
#define ABC 242
#define NAME "James Smith"

In Excel VBA, is there an equivalent for #define?

Thanks.





Jim Thomlinson

What is the #define equivalent?
 
VBA does not have a preporcessor the same as C does. What you have posted are
just constants which are handled, but if you wanted to get into defining
formulas and such then you are out of luck.
--
HTH...

Jim Thomlinson


"Sing" wrote:

Dear Excel Gurus,

In C, one can make convenient definitions like;
#define ABC 242
#define NAME "James Smith"

In Excel VBA, is there an equivalent for #define?

Thanks.





All times are GMT +1. The time now is 12:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com