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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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