Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using variables across userforms
Please can someone help me out urgently. .
I have created 5 userforms with their respective event handlers (Private Subs) and while creating these forms I used Public declared variables (one in each form; all different variable Names) Now I have created a 6th Form and want to use all five variables but VBA keeps telling me "variable not found" Please, is there a way to call and use variables across userforms or modules within a single VBA project? Thank you . . |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using variables across userforms
Did you declare your variable with a Dim? Are you sure the variable is
there? Are you sure it is spelled correctly? Please post some code (the code that causes the error). HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Genix" wrote: Please can someone help me out urgently. . I have created 5 userforms with their respective event handlers (Private Subs) and while creating these forms I used Public declared variables (one in each form; all different variable Names) Now I have created a 6th Form and want to use all five variables but VBA keeps telling me "variable not found" Please, is there a way to call and use variables across userforms or modules within a single VBA project? Thank you . . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using variables across userforms
You could refer to the variables by qualifying them:
Msgbox userform1.myVar1 But I find the simplest thing to do is to move those public variables to a General module. Genix wrote: Please can someone help me out urgently. . I have created 5 userforms with their respective event handlers (Private Subs) and while creating these forms I used Public declared variables (one in each form; all different variable Names) Now I have created a 6th Form and want to use all five variables but VBA keeps telling me "variable not found" Please, is there a way to call and use variables across userforms or modules within a single VBA project? Thank you . . -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using variables across userforms
Dear Dave,
Thanks to all the old posts since 2005 and your input I have solved the issue of using variables across modules and userforms. Thanks Though I have a separate issue about ranges will post that shortly Also thanks to HTH "Dave Peterson" wrote: You could refer to the variables by qualifying them: Msgbox userform1.myVar1 But I find the simplest thing to do is to move those public variables to a General module. Genix wrote: Please can someone help me out urgently. . I have created 5 userforms with their respective event handlers (Private Subs) and while creating these forms I used Public declared variables (one in each form; all different variable Names) Now I have created a 6th Form and want to use all five variables but VBA keeps telling me "variable not found" Please, is there a way to call and use variables across userforms or modules within a single VBA project? Thank you . . -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userforms and public variables | Excel Programming | |||
public variables, 2 userforms | Excel Programming | |||
Memory problem: Need to set object variables for userforms? Forranges? | Excel Programming | |||
UserForms and Variables and Types of data | Excel Programming | |||
Public Variables with UserForms | Excel Programming |