ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select Multiple Sheets from Menu (https://www.excelbanter.com/excel-programming/386035-re-select-multiple-sheets-menu.html)

Susan

Select Multiple Sheets from Menu
 
capp -
yes, you can do this.

go ahead & set up all the checkboxes - just keep the auto-created
names Checkbox1, Checkbox2, etc.

in your userform initialization sub, you can loop thru the checkboxes
and change the caption (what shows to the user) to the sheet names.

dim oControl as control

for each oControl in controls
if typeof oControl is msforms.checkbox then
ocontrol.caption = worksheets(1).name
end if
next oControl

hmmmmmmmm..... i'm a little lost myself. :) (relative newbie myself
6 mos or so) the above loop won't work because it will name ALL the
checkboxes the name of sheet1.
i can't see how you'd loop thru BOTH the checkboxes and the sheets;
i'm sure you can do it, but i'm on a dial-up computer here & can't
easily search the newsgroup while i'm writing this. i don't know if
you can have a "for-each" loop inside a "for-each" loop. :/

ok, alternatively, you could also do them individually....... (this
is also in the initialization sub)

checkbox1.caption = worksheets(1).name
checkbox2.caption = worksheets(2).name
checkbox3.caption = worksheets(3).name
etc.

you might need to change these to me.checkbox1 blah blah blah.
hope this helps!
if not, search the newsgroup for the problems & you'll come up with
lots of examples.
susan


On Mar 23, 4:03�pm, Capp wrote:
I have multiple worksheets in my workbook. *I have a pop-up form with
mulitple checkboxes. *I want to use this menu to to select specific sheets so
I can print them as a package. *The control source for all checkboxes are in
"data entry" worksheet. *Does someone have simple code to achieve this? *
Obviously I am a fairly new user so any help would be appreciated.

Example Sheets *-- *"Data Entry", "Title Page", "Analysis", "Chart 1",
"Chart 2" etc. * *





All times are GMT +1. The time now is 08:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com