How to print certain pages based on a cell value
<p>I have a workbook that has 3 worksheets and I have placed page breaks on the first worksheet to make the document look better.  The first worksheet is 6 pages long.  I would only like to print pages based on the value in cell E54.  If "E54"=0 then print pages 1, 5 and 6. If "E54" is greater than 0 and less than 8 then print pages 1, 2, 5 and 6. If "E54" is greater than 7 and less than 15 then print pages 1, 2, 3, 5 and 6. If "E54" is greater than 14 then print all pages.</p>

<p>Here is the Macro that I am currently using to print all worksheets.</p>

<pre><code>Sub Print_All_Pages()
'
' Run Macros to hide blank rows then print all three worksheets
'
Sheet2.Hide_Blank_Rows2
Sheet3.Hide_Blank_Rows3
'
    Sheets(Array("Inspection Report", "Device List", "Deficiencies")).Select
    Sheets("Inspection Report").Activate
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False


End Sub
</code></pre>

<p>Because I am hiding rows based on the value of cell "E54" it is still printing the pages with just the rows that are repeated at the top of every page.</p>