Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a option button control on my spread sheet and I want to be able to
set the value to either True or False using VBA code. How do I refer to that object with in my Worksheet. What I am trying to do is have VBA set will say OptButton1 to False upon the workbook being closed. Keep in mind the option button is an object in a worksheet Not a control on a User Form. Please Anyone , Help ? Dan Thompson |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Sheet1").OptionButton1 = False End Sub "Dan Thompson" wrote: I have a option button control on my spread sheet and I want to be able to set the value to either True or False using VBA code. How do I refer to that object with in my Worksheet. What I am trying to do is have VBA set will say OptButton1 to False upon the workbook being closed. Keep in mind the option button is an object in a worksheet Not a control on a User Form. Please Anyone , Help ? Dan Thompson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wouldn't put it in the code before the workbook closes. The user can still
answer no to the save prompt (or you could save without asking and maybe damage the workbook???). I'd put the code in a procedure that runs when the workbook opens: Option Explicit Sub Auto_Open() worksheets("sheet999").optionbutton1.value = false end sub Dan Thompson wrote: I have a option button control on my spread sheet and I want to be able to set the value to either True or False using VBA code. How do I refer to that object with in my Worksheet. What I am trying to do is have VBA set will say OptButton1 to False upon the workbook being closed. Keep in mind the option button is an object in a worksheet Not a control on a User Form. Please Anyone , Help ? Dan Thompson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
need help on how to grey out one option button in one group box based on the selection of another option button in another group box | Excel Programming | |||
keep source formatting is not an option in paste option button | Excel Discussion (Misc queries) | |||
option button? | Excel Programming | |||
Option Button | Excel Programming | |||
option button | Excel Discussion (Misc queries) |