Trying to have my email generating macro address it based on which radio button is checked on the excel worksheet.
Getting "subscript out of range" on this line
in below code
Getting "subscript out of range" on this line
Code:
Set ws = ActiveWorkbook.Worksheets.Item("Sheet1")
Code:
[COLOR=#252C2F][FONT=Helvetica]
Sub IfOptionButtonChecked()
Dim ws As Excel.Worksheet
Set ws = ActiveWorkbook.Worksheets.Item("Sheet1")
Dim optBtn1 As Excel.OptionButton
Set optBtn1 = ws.OptionButtons.Item("Option Button 1")
If optBtn1.Value = 1 Then ' it is checked
Debug.Print "Option Button 1 is checked"
End If
End Sub[/FONT][/COLOR]