Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM
Option Private Module not preventing cross project referencing seisman Excel Programming 2 July 29th 05 03:24 PM
Calls from sheet module to ThisWorkbook module quartz[_2_] Excel Programming 2 June 23rd 05 03:37 PM
Option Commands (Option Explicit / Option Base etc) - Scope Alan Excel Programming 8 November 1st 04 02:22 AM
Variable from a sheet module in a class module in XL XP hglamy[_2_] Excel Programming 2 October 14th 03 05:48 PM


All times are GMT +1. The time now is 03:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"