It is best to insert the SpeedUp Module and then call the routines.
In a Module:
Sub OBttnHide(sRows As String, Optional tfHide As Boolean = True) Dim a As Areas, v As Variant On Error GoTo EndSub SpeedOn Set a = Range(sRows).Rows.Areas For Each v In a v.EntireRow.Hidden = tfHide Next v EndSub: SpeedOff End Sub
In the sheet code:
Private Sub OptionButton1_Click() OBttnHide "2:3,5:5,9:10" End Sub Private Sub OptionButton2_Click() OBttnHide "2:3,5:5,9:10", False End Sub