View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Keith Keith is offline
external usenet poster
 
Posts: 55
Default Selecting control on userform with part of control name (set question)

I have a select case statement, in which I determine which group of controls
("a", "b", "c", ..."j") I need to update (groups include radiobuttons,
checkboxes, etc.); e.g., group "a" includes cb_a, opt_a1T, opt_a1F, opt_a2T,
opt_A2F, etc.


Without looping through all controls (that would be a lot of extra
searching, with one full loop for each control) I'd like to be able to set
the control references dynamically, e.g.

Select Case
Case "Green"
Use_group = "a"
End Select

Set current_opt = "opt_" & Use_group & "1T" '<<<
current_opt.value = false

Can anyone point me to the correct syntax to directly select a control based
on control name?

Many thanks,
Keith