Prevent export to pdf of sheets with zero value in particular reference cell

pwb100

New Member
Joined
May 12, 2023
Messages
16
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have successfully managed, with the help of @jolivanes , to export multiple hidden worksheets to pdf. Some of those sheets have a zero value and therefore don't require exporting. Is there a way to export only those sheets that do not have a zero value in the same reference cell in all of the sheets?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
You could try checking to see if the value in that cell is zero (0) first. If the cell you are checking is B1,

VBA Code:
Public Sub convertPDF (ws As worksheet)

    If ws.Range("B1").Value <> 0
    
        '    create pdfs    '
    
    End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,748
Messages
6,126,654
Members
449,326
Latest member
asp123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top