If CheckBox is checked Then

  • I have Excel generate email through a macro. Added a check box on the spreadsheet and trying to make it so that when checked email is sent, if unchecked email displays.
    Getting Run-time error '424': Object required on line - If CheckBox5.Value = True Then - in below bit of code


    Code
    1. If CheckBox5.Value = True Then
    2. olMail.Send
    3. If CheckBox5.Value = False Then
    4. olMail.Display
    5. End If
    6. End If
  • This example shows where to include the code in your existing macro. The only part that you are concerned with is the IF CHECKBOX1 portion. In this scenario I used an ACTIVEX checkbox on the sheet (not the UserForm Checkbox control).