View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Retain values of combo box


Have a look at the userforms collection...
problem is you can't easily access a member of that collection by name.

dim uf as object
'initialize the userform
'the initialize event of the form is triggered
set uf = userforms.add("userform1") 'or New userform1

'show the userform (activate event is triggered)
uf.show

'code returns here after form is hidden(deactivated) or
closed(terminated).

'if it is hidden the form remains in memory, and values are retained.

if userforms.count 0 then
userforms(1).show
else
msgbox "no loaded forms"
endif




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


gig wrote :

I have a userform with several combo boxes so that the user can select
certain features. Upon clicking the "OK" button, the values are then
inserted into the appropriate ranges on the spreadsheet.

Is there a way that the values selected in the combo boxes can be
retained after the userform is either hidden or dismissed. I would
like the last values selected in case the user changes his mind and
would like to edit one or two selections without having to re-select
all of them. I tried just hiding the userform, but that did not work.

Thanks,

Greg