Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Form Option Buttons and Combo Boxes in VBA

My spreadsheet is using items from the Form toolbar like
Option Buttons and Combo Boxes, but I don't understand
how to address or control them in VBA.

Another user helped me to clear all Option Buttons:
Dim opt As OptionButton
For Each opt In ActiveSheet.OptionButtons
opt.Value = False
Next opt

This works fine but how do I address a specific Option
Button, if I right click it there is no Properties
option, or do I get it from the Name Box, if that is so I
still can't see it because the Name box is too small?

Please help with 2 examples:
What is the command to set an Option Box to True
What is the command to set a Combo Box to display some
text.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Form Option Buttons and Combo Boxes in VBA

Activesheet.OptinButton s("Option Button 1").Value = xlOn

With ActiveSheet.DropDowns("Drop Down 1")
MsgBox .List(3)
End With

or

With ActiveSheet.DropDowns("Drop Down 1")
MsgBox .List(.ListIndex)
End With

to get the selected value

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Newboy18" wrote in message
...
My spreadsheet is using items from the Form toolbar like
Option Buttons and Combo Boxes, but I don't understand
how to address or control them in VBA.

Another user helped me to clear all Option Buttons:
Dim opt As OptionButton
For Each opt In ActiveSheet.OptionButtons
opt.Value = False
Next opt

This works fine but how do I address a specific Option
Button, if I right click it there is no Properties
option, or do I get it from the Name Box, if that is so I
still can't see it because the Name box is too small?

Please help with 2 examples:
What is the command to set an Option Box to True
What is the command to set a Combo Box to display some
text.



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
Hide Group Boxes Around Option Buttons salqa Excel Worksheet Functions 9 November 7th 08 09:44 PM
Check Boxes or Option Buttons Lynda Excel Discussion (Misc queries) 3 April 4th 08 02:15 PM
option buttons or check boxes meandmyindigo via OfficeKB.com New Users to Excel 2 August 7th 06 12:55 PM
Check Boxes and Option Buttons newboy18 Excel Programming 18 June 27th 04 07:00 PM
Forms: Group Boxes and Option Buttons Kathryn[_4_] Excel Programming 2 October 17th 03 02:11 AM


All times are GMT +1. The time now is 07:11 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"