ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   assigning variable across macros and modules (https://www.excelbanter.com/excel-programming/314674-assigning-variable-across-macros-modules.html)

Papa Jonah

assigning variable across macros and modules
 
How do I define a variable, such as
dim range as range, or
mytotal = activecell.value *2
so that they can be recalled when other macros or modules are run?

TIA

Bob Phillips[_6_]

assigning variable across macros and modules
 
Declare them as Public variables, in a standard code module, prior to any
procedures

e.g.

Public rng As Range


Sub test()
....

--

HTH

RP

"Papa Jonah" wrote in message
...
How do I define a variable, such as
dim range as range, or
mytotal = activecell.value *2
so that they can be recalled when other macros or modules are run?

TIA





All times are GMT +1. The time now is 07:18 PM.

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