vendredi 28 avril 2017

Run macro when any checkbox in worksheet is changed

I have a worksheet that runs several macros. One creates several sheets and following is another to create a checkbox for every column in each of the sheets that has been added. I have used row 80 as the linked cell for each checkbox in each worksheet.

I need to have a macro run every time any of the check boxes changes. Either on or off. I had added an extra worksheet called "info" that has a formula referring to each sheets row 80. Then I added a macro to that sheet so that every time one of the formulas changed it triggered the macro to run.

The problem I'm having now is I don't know what the sheet names are going to be. In the worksheet "info" I tried several different things like having a worksheet called "start" and then adding the worksheets between "start" and "info". I wrote the formula but then keep getting a error out of stack space.

I need someway to run a macro every time any checkbox in any worksheet changes. I don't need the "info" worksheet for anything else. I was only using it as a trigger for the macro.

'Formula in this worksheet counts the checkbox linkcell (row80)
'Each change fires this macro to create the final worksheet
Private Sub Worksheet_Calculate()
    Call CreateFinalWorksheet
End Sub




Aucun commentaire:

Enregistrer un commentaire