Custom print macro

  • Thread starter Thread starter BOXMAN100
  • Start date Start date
B

BOXMAN100

We have an Excel workbook that has 30 tabs in it. Depending on certai
conditions, we will not need to print every worksheet each time w
print. Need to define a macro that will look in a certain cell in eac
worksheet to determine if - it's "Y" go to the next worksheet, or i
it's "N", hide that worksheet. After the last worksheet, we will prin
entire workbook. After print, unhide all worksheets.

Thank you
 
for each sh in thisworkbook.Worksheets
if sh.Range("A1") = "N" then
sh.Visible = xlSheetHidden
end if
Next
ThisWorkbook.Printout
for each sh in thisworkbook.Worksheets
sh.Visible = xlSheetVisible
Next
 
Back
Top