View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Getting values from a dynamic userform

assume fForm is a reference to your userform

dim cbx as MSForms.Checkbox
for each c in fForm.Components
if typeof c is msforms.checkbox then
set cbx = c
msgbox c.Name & "is checked: " & cbx.Value
end if
Next

--
Regards,
Tom Ogilvy

"SupC" wrote in message
...

The spreadsheet contains x number of possible data sets to chart. A
userform is dynamically created that contains x number of checkboxes.

How do I find out which check box(es) were selected? The problem is
that the number of data sets/checkboxes can vary depending upon which
spreadsheet is opened.

On a seperate note, why is it different code to show a dynamically
created userform than one created in the VBE?

VBA.UserForms.Add(VBComp.Name).Show

vs.

UserForm1.Show


Thank you.


--
SupC
------------------------------------------------------------------------
SupC's Profile:

http://www.excelforum.com/member.php...o&userid=23941
View this thread: http://www.excelforum.com/showthread...hreadid=376054