Global Variable in Excel VBA

loopoo

New Member
Joined
Nov 10, 2005
Messages
43
Hi!

Please help me on the following issue:

I want to declare a global variable in an Excel workbook.

I used
"Public zIND As Boolean"

in the code for "ThisWorkbook".

But when I try to call its value, that is assigned on the workbook open event, I can't see it or change it from another sheet code - I want to change its values when a change occurs in a worksheet, but it's not possible because it seems that I can't see it from another worksheet.


Thanks in advance,
Chris
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

macleanb

Well-known Member
Joined
Dec 10, 2004
Messages
715
I always define my globals in modules - seem to have no issues when doing it this way...
 

Watch MrExcel Video

Forum statistics

Threads
1,118,110
Messages
5,570,250
Members
412,313
Latest member
pauloalex
Top