ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Boolean Variable Definition (https://www.excelbanter.com/excel-programming/415690-boolean-variable-definition.html)

James

Boolean Variable Definition
 
Hi, Quick question here, I hope
how do I keep a boolean variable = true and keep that value for every sub or
function that might use it? im having problems when going from one
sub/function to another. The variable keeps getting reset to = "Empty". Do i
actually have to pass it from function to function? What if its used in a
sub? or am i missing something? Thanks

Mike H

Boolean Variable Definition
 
Hi


Declare it as Public


Public MyVar As Boolean
Sub mysub()
MyVar = True
End Sub

Mike

"James" wrote:

Hi, Quick question here, I hope
how do I keep a boolean variable = true and keep that value for every sub or
function that might use it? im having problems when going from one
sub/function to another. The variable keeps getting reset to = "Empty". Do i
actually have to pass it from function to function? What if its used in a
sub? or am i missing something? Thanks



All times are GMT +1. The time now is 09:47 PM.

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