Toggle Buttons to select multiple sheets for printing

kakiebos

Board Regular
Joined
Jun 10, 2018
Messages
62
Hi All.

I created a user form with multiple toggle buttons. Each buttons represents a sheet in the spread sheet. I would like to be able to only print the pages of the buttons that the user selected.

At first I tried to use the respective click button subs to select the sheets. It only select the one sheet and as soon as I click on the next button it selects the next sheet and unselect the previous sheet.

I need it to keep all the sheets selected according to the buttons that was selected. That is if the toggle button value is true the sheet needs to be selected and if the value is false the sheet must not be selected.

What code will I need to write for this?

I would prefer not to use a list box with multi select as it is sometimes easy to forget to press the control button for multi selection and most of the users that will use this spreadsheet is not really computer literate and will not know how to use shift and control to select multiple selections in a list box.

I'm pretty new to vba, so any help will be appreciated.
 
To get the first of the month use
Code:
sdate = shSummary.Range("Y7").Value
sdate = Format(DateSerial(Year(sdate), Month(sdate), 1), "yyyymmdd")
and for the name try
Code:
Name = Application.Proper(shSummary.Range("B7").Value)
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top