print group of sheets based on a cell value

December 13, 2010 at 12:39:08
Specs: Windows XP
have several sheets that i want to print based on the cell value of the first sheet, then i want to repeat the printing process with another group of sheets. these sheets are hidden so i will need to make them visible then hide them.

example if sheet 1 cell (j35) value is >1 then print "sheet1" and also "sheet2"
cell j35 contains a function so it will not appear to be empty but i need it to check for a value grater then 1


See More: print group of sheets based on a cell value

Report •

#1
December 14, 2010 at 10:27:47
Your post is confusing.

You gave us one example (Print Sheets 1 & 2 if Sheet1!J35 >1) but I don't know what you mean by "then i want to repeat the printing process with another group of sheets".

I also don't know which sheets are hidden and which ones aren't.

Since macros need to be told exactly what you want them to do, you'll need to be a little more specific.

Posting Tip: Before posting Data or VBA Code, read this How-To.


Report •

#2
December 14, 2010 at 16:06:13

i see, i really am out of my element here, that is why I appear to be somewhat confusing..

let me explain I have 4 input screens each generate 2 analysis sheets, all analysis sheets are hidded.

example sheet 1 goes with sheet 2 o if there is a value that is greater then 1 in cell {j35} of sheet one then i want the program to print sheet 1 and 2.

then the program will look at sheets 3 and 4 and if the cell value of (j35) in sheet 3 is > then 1 then sheet 3 and 4 are printed.
this cycles through sheet 5&6 and 7&8 at the end i want the program to also print the summary page which is one sheet sheet 9

so i would need the macro to unie the sheets look for the value print if true then hide the sheet back then move on to the next set of sheets.


hope that explains it better.



Report •

#3
December 14, 2010 at 20:39:29
re: "let me explain I have 4 input screens each generate 2 analysis sheets, all analysis sheets are hidded."

What's an "input screen"?

When you refer to the sheets as "sheet 1 and 2", "sheets 3 and 4", etc. are you actually talking about the sheets as they are ordered in the workbook?

If sheets 1 - 8 are hidden, what sheet(s) is(are) normally visible?

Posting Tip: Before posting Data or VBA Code, read this How-To.


Report •

Related Solutions

#4
December 14, 2010 at 21:42:10
Thank you for being patient...

What I am trying to do is this.


The program calculates 4 different cost/savings analysis. It also allows for inputting 4 separate plans- so a company could have up to 4 plans.

Each input screen. Generates 2 sheets for each analysis and a summary sheet.

If data is not entered for a specific analysis then the sheet containing that report will be blank, that is why I want the print macro to check if there is data in the cell (j35) in the first of the 2 sheets so that it only print the necessary pages pus the summary page.

I am thinking to set up 4 separate print buttons each or a specific analysis, that way an agent can print whatever he/she needs based on the original input, reason being is that if the agent did not input specific data for a break even analysis then he/she would not be printing this reports.

I would have one macro to print a standard savings analysis.
So the logic is this: Standard savings analysis- sheets with yellow tabs

Input screen 1 = populates “Sav. Proposal 1” & “EE-ER by class propsl 1 plan 1”
Input screen 2 = populates “Sav.proposal2” & “EE-ER by class propsl2”
Input screen 3= populates “ Sav.proposal3” & “EE-ER by class proposl3”
Input screen 4= populates “ Sav.proposal4” & “EE-ER by class propsl4”

And the totals from the above sheets populates the “standard saving summary.”
So I want to print the saving summary when cell (j35) of the “ Sav.proposal 1” is >1


I can then create another macro for a custom analysis. And repeat the process by changing the names of the sheets that will be printed.

All of the report sheets are hidden so the macro will need to unhide them, check for the cell value, print or skip then hide the sheet again.


again template 1 will produce 2 sheets that i want to print out only if the cell value of (j35) in (sheet1) is >1 please note that cell (j35) contains a formula so it is not blank that is why i want to chech that the value is greater then 1.

if the value is >n 1 then sheei1 & 2 are printed otherwise no, then i want the program to look at sheet 3&4 and apply the same logic. at the end i want the program to look at sheet1 again and if the value of cell (j35) is > 1 print "summary sheet"

the cell j35 in each sheet is a total so i am thinking that if J35 has a value greater then 1 then the actual sheet contains data that is printable and therefore both sheets need to b printed.

Thank you



Report •

Ask Question