Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use the Option box value in a module
Hi all, i hope i explain this correctly. I have 3 option boxes on a form
that you can select one of them. I then go into the module code and need to know which option button is true and not being a programmer i am not sure how to do it. Could somebody please help? Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use the Option box value in a module
'UserForm1 is the name of the form
'OptionButton1 is the name of the first button If UserForm1.OptionButton1.Value = True Then MsgBox "OptionButton1 selected" If UserForm1.OptionButton2.Value = True Then MsgBox "OptionButton2 selected" If UserForm1.OptionButton3.Value = True Then MsgBox "OptionButton3 selected" -- Ronald Ferdinandus http://www.ro-pay.nl "Tempy" wrote: Hi all, i hope i explain this correctly. I have 3 option boxes on a form that you can select one of them. I then go into the module code and need to know which option button is true and not being a programmer i am not sure how to do it. Could somebody please help? Tempy *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use the Option box value in a module
Dim i as Long, j as Long
Dim obx as MSControls.OptionButton for i = 1 to 3 if userform1.Controls("OptionButton" & i).Value then j = i exit for end if Next set obx = userform1.Controls("OptionButton" & j) -- Regards, Tom Ogilvy "Tempy" wrote in message ... Hi all, i hope i explain this correctly. I have 3 option boxes on a form that you can select one of them. I then go into the module code and need to know which option button is true and not being a programmer i am not sure how to do it. Could somebody please help? Tempy *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) | |||
Option Private Module not preventing cross project referencing | Excel Programming | |||
Calls from sheet module to ThisWorkbook module | Excel Programming | |||
Option Commands (Option Explicit / Option Base etc) - Scope | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |