Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to access a value from excel option button using visual basic?
Hi,
my name is henry. I want to ask how to access a value in Excel option button which is using xlformcontrol.xloptionbutton which the value i want to show in textbox as information. i've coding : msgbox excel.xlformcontrol.xloptionbutton and it displayed number 7 which the const of xloptionbutton what i want is the value inside the optionbutton not the const. does anyone know the answer? thank's in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to access a value from excel option button using visual basic?
Msgbox Optionbutton1.Value
But it will show True or False, that is set or not. -- HTH RP (remove nothere from the email address if mailing direct) "henry" wrote in message m... Hi, my name is henry. I want to ask how to access a value in Excel option button which is using xlformcontrol.xloptionbutton which the value i want to show in textbox as information. i've coding : msgbox excel.xlformcontrol.xloptionbutton and it displayed number 7 which the const of xloptionbutton what i want is the value inside the optionbutton not the const. does anyone know the answer? thank's in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to access a value from excel option button using visual basic?
Hi Henry,
What you are checking is just the value of the constant that XL uses to identify the type of shape. For more search XL VBA help for xlformcontrol and you will be led to the 'FormControlType Property' page. What you want to do is check the caption of the option button that the user selected. Assuming you put multiple option buttons within a group box in a worksheet, XL will ensure that only one of the option buttons is selected at any given time. Then, you can use code like: Dim i As Integer With ActiveSheet For i = 1 To .OptionButtons.Count If .OptionButtons(i).Value = 1 Then .Labels(1).Caption = .OptionButtons(i).Caption End If Next i End With -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... Hi, my name is henry. I want to ask how to access a value in Excel option button which is using xlformcontrol.xloptionbutton which the value i want to show in textbox as information. i've coding : msgbox excel.xlformcontrol.xloptionbutton and it displayed number 7 which the const of xloptionbutton what i want is the value inside the optionbutton not the const. does anyone know the answer? thank's in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I access Visual Basic in Excel 2007 Trial? | Setting up and Configuration of Excel | |||
Create and Use Button Menu using visual Basic in Excel | Excel Discussion (Misc queries) | |||
Activate check "Trust access to Visual Basic " in Excel | New Users to Excel | |||
This option(Trust access to visual basic project ) is not active . | Excel Programming | |||
Stopping Excel after running visual basic in Access | Excel Programming |