Multiple Command button programming

  • Thread starter Thread starter Good Time
  • Start date Start date
G

Good Time

I have a workbook with 5 spreadsheets in it. Each sheet has a series
of command buttons.

CommandButton1 in each sheet deletes the contents of that worksheet.

I would like to program a general command button in the first
spreadsheet that deletes the contents of all the sheets in the
workbook by activating commandbutton1 in each spreadsheet.

Is this possible

thank you
 
so you have
Private CommandButton1_Click()
Change that to
Public CommandButton1_Click()
And now you can call it from other sheets or modules something like this

Sheet1.CommandButton1_Click
or
Sheets("mysheet").CommandButton1_Click
 
so you have
Private CommandButton1_Click()
Change that to
Public CommandButton1_Click()
And now you can call it from other sheets or modules something like this

Sheet1.CommandButton1_Click
or
Sheets("mysheet").CommandButton1_Click
 
Back
Top