Deselect Command Button by Selecting another Command Button

G

gmcnaugh

Hi,

I am attempting to automaticlly deselect a focused comand button when
another command button is selected in Excel. I have tried using the
following code:

Private Sub booOVERREAD_Click()
If booOVERREAD = True Then
booUNDERREAD = False
End If

I am a relative novice when it comes to VBA so any help would be
gratefully received.

I thank you.
 
R

Rick Rothstein

Unless I am missing something in your question, you don't need any code to
do that... only one command button at a time will have focus... selecting a
different command button should automatically deselect the previously
selected one.
 
G

gmcnaugh

Unless I am missing something in your question, you don't need any code to
do that... only one command button at a time will have focus... selectinga
different command button should automatically deselect the previously
selected one.

--
Rick (MVP - Excel)










- Show quoted text -

Hi Rick,

Thanks for the reply. It may help if I tell you that these buttons
when pushed generate a code and text representing the code. E.g. the
buttons which I previously showed code for generate the code letters A
& R respectively along with the text "Over Read" and "Under Read".

I am trying to achieve the functionality of a radio button I suppose,
in that if say the "Over Read" button is pressed the relevant letter
and text will show, however, if the "Under Read" button is pressed
after the "Over Read" then the "Under Read" text and letter are
removed and replaced with the "Over Read" text and letter.

The reason for the command buttons and not radios is that the Human
Input Device will be a touchscreen operated by personnel using
gloves. I have found that radio buttons are too small when using the
touch screen whilst command buttons are far more adaptable. If you
think bar til then that is what I am trying to achieve!

I hope this clarifys my end goal.

Thank you.
 
G

gmcnaugh

Hi Rick,

Thanks for the reply. It may help if I tell you that these buttons
when pushed generate a code and text representing the code. E.g. the
buttons which I previously showed code for generate the code letters A
& R respectively along with the text "Over Read" and "Under Read".

I am trying to achieve the functionality of a radio button I suppose,
in that if say the "Over Read" button is pressed the relevant letter
and text will show, however, if the "Under Read" button is pressed
after the "Over Read" then the "Under Read" text and letter are
removed and replaced with the "Over Read" text and letter.

The reason for the command buttons and not radios is that the Human
Input Device will be a touchscreen operated by personnel using
gloves.  I have found that radio buttons are too small when using the
touch screen whilst command buttons are far more adaptable.  If you
think bar til then that is what I am trying to achieve!

I hope this clarifys my end goal.

Thank you.- Hide quoted text -

- Show quoted text -

Hi again Rick.

I have now managed to work this out for myself. Thank you for taking
the time to reply anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top