Forum Discussion
pkbarnett
Jan 16, 2019Copper Contributor
Control Buttons
I am setting up control buttons for printing on a workbook that has multiple tabs. (worksheets on each tab). Is there a way to put all of the control buttons (used for printing different sheets) on o...
JKPieterse
Jan 16, 2019Silver Contributor
If you use buttons from the Forms set you can do it like this:
- Add a list of worksheet names to the first worksheet
- Next to each one, insert a button from the Forms buttons and attach it to the following macro:
Sub PrintIt() Worksheets(Activesheet.Buttons(Application.Caller).TopLeftCell.Offset(0, -1).Value).Activate 'Now here goes your printing code, I assume it is the same for each sheet End Sub
The code above assumes the button is in a column immediately to the right of the column with sheet names. Make sure the top-left corner is within that cell.