ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   option butten (https://www.excelbanter.com/excel-programming/385455-option-butten.html)

[email protected]

option butten
 
i have a quick excel question that involves macro.

basically, what i need to do is this.

i have option buttons and when one out of three buttons is clicked, it
needs to put the value "1" in the cell right behind the selected
option button and "0" into each cell behind other option buttons.

do you have any suggestions for the macro?


much thanks in advance,

hyejin


Dave Peterson

option butten
 
How about using a linked cell and a few formulas:

I put a groupbox from the Forms toolbar on a worksheet.
I put 3 optionbuttons from the forms toolbar inside that groupbox.

Then I assigned the linked cell (to the first optionbutton) to an out of the way
location (A1 in my sample).

Then I put:
=--(a1=1)
behind the first optionbutton

=--(a1=2)
behind the second

and
=--(a1=3)
behind the third.

(a1=1) returns true or false
--(true or false) becomes 1 or 0.

====
But maybe just looking at the linked cell would be easier???????


wrote:

i have a quick excel question that involves macro.

basically, what i need to do is this.

i have option buttons and when one out of three buttons is clicked, it
needs to put the value "1" in the cell right behind the selected
option button and "0" into each cell behind other option buttons.

do you have any suggestions for the macro?

much thanks in advance,

hyejin


--

Dave Peterson


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com