View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] johnhildreth@citynet.net is offline
external usenet poster
 
Posts: 43
Default Grouped option buttons on forms

On Feb 12, 2:58 pm, "merjet" wrote:
Dim c As Control
Dim x As Integer
For Each c In UserForm1.Controls
If c.GroupName = "Season" And c.Value = True Then
x = Right(c.Name, Len(c.Name) - 12)
End If
Next c

Hth,
Merjet




I spoke too soon....I want to check each by GroupName and Value, but
c.GroupName is not valid. Only OptionButtons have GroupNames,
controls do not. So I tried:

Dim o As OptionButton

DrngPied.Show 'DrngPied is the form

For Each o In DrngPied.Controls
If o.GroupName = "SizeOptions" And o.Value = -1 Then
sSize = c.Name
End If
Next o


but I get a Type Mismatch at the For Each line.

John