locked
Excel vba, read multiple checkboxes sharing the same sub? RRS feed

  • Question

  • Probably a little late to ask this but is there a way to consolidate code, for when every checkbox on the form calls the same routine.

    Private Sub CheckBox20_Click()
    CheckBox_Click CheckBox20
    End Sub


    heads up

    Tuesday, October 21, 2014 5:57 PM

Answers

  • Copy the routine in a Function and call the Function in each CheckBox.

    That looks like the approach that would work in your situation.

    Below an example on how to accomplish this.

    Writing Your First VBA Function in Excel

    Hope this helps,


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"

    Please vote an answer helpful if they helped. Please mark an answer(s) as an answer when your question is being answered.

    • Marked as answer by Caillen Sunday, November 9, 2014 12:38 PM
    Tuesday, October 21, 2014 6:39 PM