Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I'm a fresher to VBA scripting. I'm trying to assign a value to a global variable defined in Userform' General Declaration and then using that value in my module. tried my way but values are blank when my Userform ends. any suggestion would be a gr8 help. Calling all life savers..."HELP". |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think the easiest thing to do is to move the declaration to a general module.
Public MyVar as WhatEver Anoop wrote: Hi I'm a fresher to VBA scripting. I'm trying to assign a value to a global variable defined in Userform' General Declaration and then using that value in my module. tried my way but values are blank when my Userform ends. any suggestion would be a gr8 help. Calling all life savers..."HELP". -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set it as a property of that form.
In the form add Public Property Get MyVar As String myVar = your_variable_name End Property and in the module where you show the form, retrieve the property afterwards With Userform1 .Show module_variable = .MyVar End With -- __________________________________ HTH Bob "Anoop" wrote in message ... Hi I'm a fresher to VBA scripting. I'm trying to assign a value to a global variable defined in Userform' General Declaration and then using that value in my module. tried my way but values are blank when my Userform ends. any suggestion would be a gr8 help. Calling all life savers..."HELP". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Set Global Variable Inside Object Module | Excel Programming | |||
Pass variable from module to userform and back | Excel Programming | |||
Global (Module) Variable Problem | Excel Programming | |||
userform variable as global | Excel Programming | |||
Global module | Excel Programming |