Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Set Focus a row - Option Button Click
How to Set Focus to the row - Option Button Click
***My Problem*** when you click on an Option Button it does not change the focus or make the Option Button cell the active cell. in my worksheet I have a Option Button in every row that will run a macro that uses the values from the cells in the active row I would like to set the focus or make the row from where the Button is pressed, the active row ***example *** If I click on a cell in row 3 then click on the option button in row 5 the code that runs uses the values from row 3 - because clicking on the Option Button does not change the focus off of row 3 and onto row 5 When I click on the option button in row 5, I want to make row 5 the active row so the macro will use the values in row 5 does anyone have any ideas on how to change the focus when an Option Button is clicked? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Set Focus a row - Option Button Click
You need to change the LinkCell property of the Option button.
On excel spreadsheet Menu - View - toolbar - Control Toolbar. Enter design mode (triangle). Then press conhtrol button and select properties on the toolbar. Chenge LinkCell to any cell. Then double click option button to open a VBA macro. Add code below. Each button will have its own macro. Private Sub OptionButton1_Click() linkcell = OptionButton1.LinkedCell Range(linkcell).Select End Sub "Lisab" wrote: How to Set Focus to the row - Option Button Click ***My Problem*** when you click on an Option Button it does not change the focus or make the Option Button cell the active cell. in my worksheet I have a Option Button in every row that will run a macro that uses the values from the cells in the active row I would like to set the focus or make the row from where the Button is pressed, the active row ***example *** If I click on a cell in row 3 then click on the option button in row 5 the code that runs uses the values from row 3 - because clicking on the Option Button does not change the focus off of row 3 and onto row 5 When I click on the option button in row 5, I want to make row 5 the active row so the macro will use the values in row 5 does anyone have any ideas on how to change the focus when an Option Button is clicked? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Set Focus a row - Option Button Click
I used the Option button from the Forms toolbox
When I look at the Command Button from the Control Toolbar I do not see the LinkCell Property in the property window. However, there is a TakeFocusOnClick property. I am going to change my option butttons to command buttons and see if that works. "Joel" wrote: You need to change the LinkCell property of the Option button. On excel spreadsheet Menu - View - toolbar - Control Toolbar. Enter design mode (triangle). Then press conhtrol button and select properties on the toolbar. Chenge LinkCell to any cell. Then double click option button to open a VBA macro. Add code below. Each button will have its own macro. Private Sub OptionButton1_Click() linkcell = OptionButton1.LinkedCell Range(linkcell).Select End Sub "Lisab" wrote: How to Set Focus to the row - Option Button Click ***My Problem*** when you click on an Option Button it does not change the focus or make the Option Button cell the active cell. in my worksheet I have a Option Button in every row that will run a macro that uses the values from the cells in the active row I would like to set the focus or make the row from where the Button is pressed, the active row ***example *** If I click on a cell in row 3 then click on the option button in row 5 the code that runs uses the values from row 3 - because clicking on the Option Button does not change the focus off of row 3 and onto row 5 When I click on the option button in row 5, I want to make row 5 the active row so the macro will use the values in row 5 does anyone have any ideas on how to change the focus when an Option Button is clicked? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Click Option Button 2x in a Row | Excel Discussion (Misc queries) | |||
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 | |||
Option Button/Focus Problem on Worksheet | Excel Programming | |||
commnd button - when i rt click, "assign macro" isnt an option... | Excel Programming | |||
Code to tab from option button click | Excel Programming |