LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default userform inputs

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quarterly inputs Loadmaster Excel Worksheet Functions 2 August 28th 09 03:22 PM
custom inputs Tom Excel Discussion (Misc queries) 1 September 2nd 08 10:39 PM
A question of two inputs Finance Guru Excel Worksheet Functions 0 March 27th 08 01:58 PM
Prevent Hard Inputs Frederik12 Excel Discussion (Misc queries) 3 August 15th 06 05:14 PM
Copying field inputs BobR Excel Discussion (Misc queries) 1 February 23rd 05 07:49 PM


All times are GMT +1. The time now is 06:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"