Conditional Sheet Selection

L

lobster

I have 30 sheets in a workbook, say called 'Sheet1', Sheet2' etc up t
'Sheet30' - which contain the data I wish to print.

I have a menu sheet at the front which in one column, say column 'B
has a list of all the sheets. B1 = 'Sheet1', B2 = 'Sheet2'
etc all the way to cell B30, which = 'Sheet30'

I would like to put a 'Y' in column 'A' next to the sheet names I wis
to print and run a script which selects all the relevant sheets, thos
with a 'Y' next to them, and prints them out.

If anyone can offer any help it would be greatly appreciated.

Many thanks in advance
 
F

Frank Kabel

Hi
not fully tested but try something like the following:
sub multi_print
Dim rng as range
Dim cell as range
set rng = worksheets("menu_sheet").range("A1:A30")
for each cell in rng
if cell.value = "Y" then
worksheets(cell.offset(0,1).value).printout
end if
next
end sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top