ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   DEclaring variables (https://www.excelbanter.com/excel-programming/282439-re-declaring-variables.html)

PEdro

DEclaring variables
 
I am declaring it in the standard module



"Chip Pearson" wrote in message
...
Pedro,

Are you declaring the variable in a standard code module, rather than a
sheet's code module or a form or ThisWorkbook?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Pedro" wrote in message
...
Hi
I have declares as a Public variable strNumber doing:
Public strNumber as variant
when the code opens runs other module in a different worksheet the

variable
is empty

how to solve it?
thanks
Pedro

ps. Chip thanks for all your help








Chip Pearson

DEclaring variables
 
Pedro,

The only thing I can think of is that the variable is misspelled. Do you
have "Option Explicit" at the top of all your code modules? You should,
since the will require that all variable be explicitly declared, and
misspelled variables will be flagged by the compiler.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Pedro" wrote in message
...
I am declaring it in the standard module



"Chip Pearson" wrote in message
...
Pedro,

Are you declaring the variable in a standard code module, rather than a
sheet's code module or a form or ThisWorkbook?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Pedro" wrote in message
...
Hi
I have declares as a Public variable strNumber doing:
Public strNumber as variant
when the code opens runs other module in a different worksheet the

variable
is empty

how to solve it?
thanks
Pedro

ps. Chip thanks for all your help











All times are GMT +1. The time now is 02:35 PM.

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