简体   繁体   中英

Using a code snippet multiple times in vba excel

My problem is that I've a String variable strTemp5. I just want to give it a value once in my public sub and then use it in 33 normal subs. But it appears that I've to define it everytime right now. Is there any way I can use the same String by only defining it once.

If it's only ever the same value.

Public Const <variable> as <type> = x

Example.

Public Const numberofbats as Long = 6

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM