refering to option buttions

  • Thread starter Thread starter mark kubicki
  • Start date Start date
M

mark kubicki

i want to refer to 1 of several option buttons.
the choice of which button is determined by the value stored as a named
range (EmployeePosition)...

in the following, if the value of Employee Range = "Assoc",
i would want the value of the option button: obAssoc on UserForm1 to be true

Dim obEmployeePostion As Object
obEmployeePosition = "ob" & [EmployeePosition]
Load UserForm1
UserForm1.obEmployeePosition.Value = True
End Sub

......
doesn't seem to be the right approach...
thanks in advance, mark
 
Where are you storing EmployeePosition, cell, textbox?
If cell then you can use:
'cells(1,1) refers to cell A1
If Cells(1,1) = "Assoc" Then
Load UserForm1
UserForm1.obEmployeePosition.Value = True
End If

If you are using a TextBox then you can use:
If Textbox1.value = "Assoc" Then
Load UserForm1
UserForm1.obEmployeePosition.Value = True
End If
HTH
 
neither,
it is being stored as a constant as a "name" (XL/insert/names/define...
only i'm doing it through VBA: add.names... refers to... )

Mark Kubicki
(e-mail address removed)
 
Back
Top