Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi, I need your help to solve a scope problem.
I want a variable that can be accessed in "ThisWorkBook", and other Sheets. I tried to create a public variable in "ThisWorkBook", but I got a undefined error, when tried to use it at other sheets module.... Also, How can I create a procedure in "ThisWorkBook" and can be accessed in other sheets. Thanks for your help. Johnny. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Put the Public variable in a standard module.
Code in all modules can then use it. Place your procedure in a standard module and you can then call it from any module ... Call MyOtherProcedure If for some reason you must place the procedure in the ThisWorkbook module, you can call it from another module with this syntax ... Call ThisWorkbook.MyOtherProcedure -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "johnny"wrote in message Hi, I need your help to solve a scope problem. I want a variable that can be accessed in "ThisWorkBook", and other Sheets. I tried to create a public variable in "ThisWorkBook", but I got a undefined error, when tried to use it at other sheets module.... Also, How can I create a procedure in "ThisWorkBook" and can be accessed in other sheets. Thanks for your help. Johnny. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Feb 23, 11:39 pm, "Jim Cone" wrote:
Put the Public variable in a standard module. Code in all modules can then use it. Place your procedure in a standard module and you can then call it from any module ... Call MyOtherProcedure If for some reason you must place the procedure in the ThisWorkbook module, you can call it from another module with this syntax ... Call ThisWorkbook.MyOtherProcedure -- Jim Cone San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "johnny"wrote in message Hi, I need your help to solve a scope problem. I want a variable that can be accessed in "ThisWorkBook", and other Sheets. I tried to create a public variable in "ThisWorkBook", but I got a undefined error, when tried to use it at other sheets module.... Also, How can I create a procedure in "ThisWorkBook" and can be accessed in other sheets. Thanks for your help. Johnny. Thanks a lot. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Public Variables | Excel Discussion (Misc queries) | |||
Declaring variables in Module vs. Public | Excel Discussion (Misc queries) | |||
Public Password | Excel Discussion (Misc queries) | |||
Using A Public Function / | Excel Worksheet Functions | |||
Public Curiosity | Excel Discussion (Misc queries) |