Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Unselect OptionButton. How to?

Folks,

I have a macro with a data input screen.

Amongst others there are 5 optionbuttons. The macor must not continue
without one checked.

I do that by each subroutine of each option button writes the value 1
in a cell.

If there is no value 1 in that cell the macro will clear all selections
restart.

The problem is that now it cleared the 1 and it thinks no button is
selected, but really the button is STILL selected.

Is there a way to uncheck these buttons from inside the macro? OR at
least reset them all to default, like when the macro starts the first
time?

Thanks!
Matt

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unselect OptionButton. How to?


Hello Matt,

Since you don't say if the buttons are on a worksheet or a user form,
am giving methods for either type of button.

FORMS TOOLBAR OPTION BUTTO

Sub ClearOptionButton()

Shapes("Option Button 1").ControlFormat.Value = False

End Sub

To set the button, change False to True.


CONTROL TOOLBOX (VBA

Sub ClearOptionButton()

OptionButton1.Value = False

End Sub

The Option Button Control name is in Red. Change this to match the nam
of the control to be reset.

Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=47841

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Unselect OptionButton. How to?

Its on a user form. Thanks for your help! :)

Will be able to try it on monday...

Matt

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Unselect OptionButton. How to?

Works like a charm :)

Even better I am now (trying) to use Rowsource to select the range for
the drop down menu based on the amount of cells I have (varies all the
time).

Now the problem is that if I select rowsource before I open the form it
gives an error and otherwiese the dropdown menu wont adjust its size
until after the user clicks somehting..

How can I use the rowsource for a combox command before the form is
visible?

Matt

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unselect OptionButton. How to?


Hello Matt,

Generally when you link a editing object (Textbox, ComboBox) to a cell
it is pass the information from the control to the worksheet cell. You
are doing the reverse. You can more than likely use another method to
load the ComboBox based on the cells. Can you post or emial your
workbook so I can see what you are doing? I will faster than doing
multiple posts trying to explain.

Thanks,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=478412



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Unselect OptionButton. How to?

Hi Leith,

thanks for your offer to help! I was able to solve the problem by
useing a suggestion posted by some of the other guys. But I am still
having problems with weird textbox behaviour...

I cant seem to retrieve your email address though :(

Matt

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
unselect cells tgi Excel Discussion (Misc queries) 1 October 1st 09 03:21 AM
unselect cells tgi Excel Discussion (Misc queries) 2 October 1st 09 01:39 AM
Unselect Option Box Jon Excel Discussion (Misc queries) 1 May 18th 05 01:02 AM
Unselect a Cell?????? Andoni[_25_] Excel Programming 3 September 3rd 04 07:49 PM
Unselect Filtre .... sal21[_12_] Excel Programming 1 February 23rd 04 01:54 PM


All times are GMT +1. The time now is 09:24 PM.

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"