ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   refering to option buttions (https://www.excelbanter.com/excel-programming/287241-refering-option-buttions.html)

Mark Kubicki

refering to option buttions
 
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



Cliff Myers

refering to option buttions
 
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
"mark kubicki" wrote in message
..
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





Mark Kubicki

refering to option buttions
 
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


*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

mark kubicki

refering to option buttions
 
as a "NAME" (XL/insert/names... but created/stored thru VBA, names.add...
refers to...)

note:
the option buttion is reffered to as ob+(the value stored in the "NAME":
EmployeePosition
ex: if EmployeePosition stored the value Assoc, the option button is obAssoc
in the "NAME"(EmployeePositon) only the description of the actual position
is stored; i need to add the prefix "ob" to correctly refer to the object
option button

....my though is that this way i could concatenate the value of (Employee
Position) with different prefixes to access different stuff all relating to
that value

(is this confusing?)

"Cliff Myers" wrote in message
...
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
"mark kubicki" wrote in message
..
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








All times are GMT +1. The time now is 02:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com