BTwo SaurabhTripathi
BTwo SaurabhTripathi

Reputation: 11

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.

Upvotes: 0

Views: 104

Answers (1)

user2801423
user2801423

Reputation: 11

If it's only ever the same value.

Public Const <variable> as <type> = x

Example.

Public Const numberofbats as Long = 6

Upvotes: 1

Related Questions