Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
any way to preserve a variable set when an optionbutton is true, a
commandbutton is clicked and the userform hidden? doesn't seem to want to be available after it's hidden. i know i could store it on a sheet, but didn't want to do that. even tried a public variable and it didn't work either -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
seems to be working now and i didn't change anything.
-- Gary "Gary Keramidas" <GKeramidasATmsn.com wrote in message ... any way to preserve a variable set when an optionbutton is true, a commandbutton is clicked and the userform hidden? doesn't seem to want to be available after it's hidden. i know i could store it on a sheet, but didn't want to do that. even tried a public variable and it didn't work either -- Gary |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary,
Well this is the answer I was going to give: <g As long as the form is not Unloaded then all you need is... x = UserForm1.OptionButton1.Value If it is some value you determined while the form was open, then assign the value to the .Tag property of the OptionButton ... OptionButton1.Tag = "Mush" or OptionButton1.Tag = CStr(LongVariable) Then after the form is hidden... x = CLng(UserForm1.OptionButton1.Tag) Regards, Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Gary Keramidas" <GKeramidasATmsn.com wrote in message any way to preserve a variable set when an optionbutton is true, a commandbutton is clicked and the userform hidden? doesn't seem to want to be available after it's hidden. i know i could store it on a sheet, but didn't want to do that. even tried a public variable and it didn't work either -- Gary |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks jim
-- Gary "Jim Cone" wrote in message ... Hi Gary, Well this is the answer I was going to give: <g As long as the form is not Unloaded then all you need is... x = UserForm1.OptionButton1.Value If it is some value you determined while the form was open, then assign the value to the .Tag property of the OptionButton ... OptionButton1.Tag = "Mush" or OptionButton1.Tag = CStr(LongVariable) Then after the form is hidden... x = CLng(UserForm1.OptionButton1.Tag) Regards, Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Gary Keramidas" <GKeramidasATmsn.com wrote in message any way to preserve a variable set when an optionbutton is true, a commandbutton is clicked and the userform hidden? doesn't seem to want to be available after it's hidden. i know i could store it on a sheet, but didn't want to do that. even tried a public variable and it didn't work either -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform and variable | Excel Discussion (Misc queries) | |||
VBA Variable as userform | Excel Programming | |||
Variable ComboBox on Userform | Excel Programming | |||
userform variable as global | Excel Programming | |||
Passing a value to a variable from Userform | Excel Programming |