Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jo,
(i) call fruit selected in a regular macro you can always feed the called macro with a parameter. I guess you have an OK button in your userform? Then just have something like this Private Sub cmdOk_Click() Call YourMacro(Me.cboFruits.Value) End Sub Sub YourMacro(strFruit as String) ' here's the macro that does the processing.... End Sub (ii) fill in another userform with the selection. One way is to keep the original userform loaded but hidden. So when OK button is pressed, this happens: Private Sub cmdOk_Click() frmYourUserform.Hide Call YourMacro(Me.cboFruits.Value) End Sub When it's open but hidden you can refer to the userform controls by strWhatEverValue = frmYourUserform.cboFruits.Value I'd recommend then unload the userform when it is not needed anymore by command Unload frmYourUserform One workaround would also be declaring a public variable, which then is used for storing the values. Unfortunately it's been a while when I last time used one with many userforms so I cannot recall all the details and you might end up losing the value when opening and closing several forms... But you can always play around and see which way works :-) HTH, Jouni Finland "Jo" wrote in message ... Hi How do I retain information form a userform option box to use in later modules. eg. from a list a fruit I could tell apples had been selected by a user (using a for next grop within the frame controls) how do I then (i) call fruit selected in a regular macro (ii) fill in another userform with the selection. I think I somehow need to declare user fruit choice, but I am not sure how. Any help much appreciated Jo |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Quarterly inputs | Excel Worksheet Functions | |||
custom inputs | Excel Discussion (Misc queries) | |||
A question of two inputs | Excel Worksheet Functions | |||
Prevent Hard Inputs | Excel Discussion (Misc queries) | |||
Copying field inputs | Excel Discussion (Misc queries) |