Defining a global string for entire project

RSXchin

Well-known Member
Joined
Oct 23, 2010
Messages
758
I'm about to leave my company, but I don't want to leave them up a creek and unable to edit my code.

To do this, I'm going to make everything super easy on them by putting all the things they would ever update into a module. Mostly filenames.

How would I define (and call) a string variable that is to be used throughout several modules?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Rich (BB code):
Public Const gcstr_FILENAME as string = "C:\blah.xls"
for example.
 
Upvote 0
yes, but where would I put that? should it go in a class module?

My goal is to have a module of JUST public constants that they would change, and nothing else.
 
Upvote 0
No, just a normal module.
Good practice to do this anyway... :)
 
Upvote 0
Yes, though you don't actually need the Module1 part.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,754
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top