Macro to reset Option Button to specific selection

J_Weston

New Member
Joined
May 13, 2021
Messages
1
Office Version
  1. 365
Platform
  1. MacOS
Good morning,

I have 5 group boxes on a worksheet, and they have varying quantities of Option Buttons within those groups. I am looking to create a macro that resets those Option Buttons back to specific selections (in some groups select option 1, in other groups it will select different buttons)

In the past I was using this macro:

VBA Code:
Sub Reset()
'
' Reset Macro
'

'
    Range("C5").Select
    ActiveCell.FormulaR1C1 = "3"
    Range("C12").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("C20").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B21").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("B22").Select
    ActiveCell.FormulaR1C1 = "0"
    Range("I36").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("I41").Select
    ActiveCell.FormulaR1C1 = "1"
    ActiveWindow.SmallScroll Down:=-200
    Range("I41").Select
    ActiveCell.FormulaR1C1 = "=IF(R[-15]C[-4]>1920,2,1)"
    Range("B21").Select
End Sub

What I was doing was assigned FormulaR1C1 to the cell that was "Cell Linked" to the result of the Groupbox that was getting me the result I needed to change the Option Button back to a specific choice.

However now I have moved the Cell Link, and the hidden formulas to a new Sheet. Reason for this is to clean up the Sheet that is exposed. I am having a hard time adapting this macro to assign the value into the corresponding cell on the new sheet. I would like to not change pages, just for the macro to work in the background.

Any thoughts? Any more information needed?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top