Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
HI all,
I'm so confused about this. I've declared a variable and assigned a value in one module and want to use it in another (or a few) but I seem to lose the value once I leave the standard module that I started from. I've include a code example of what I'm trying to do. Any help is always appreciated. -- jeff ... I used to have a handle on life, but it broke. 'in module1 Public Sub MYPaths() Dim vbackup As String vbackup = Sheets("mypaths").Range("d2").Value Debug.Print vbackup ' this works fine and I view the value perfectly in immediate window end sub 'in module2 Public Sub Test() debug.print vbackup 'returns nothing in the immediate window end sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
scope/ lifetime of variable | Excel Programming | |||
Variable Scope | Excel Programming | |||
Variable scope | Excel Programming | |||
Scope of a public variable | Excel Programming | |||
module-level variable lifetime | Excel Programming |