Basically there are 11 worksheets I need printed in a single pdf file. 1st worksheet needs to be fully printed, other 10 need to be based on a condition of a particular cell being >0.
In my case there is a number that is spit out into a particular cell for each worksheet. Half are C16, other half is C20 (And I can't change them all to be the exact same, because other codes are reliant on it too).
Is there a way to create a macro that would print all these worksheets into one pdf file with this condition in place?
Here's a code I tried that doesn't have the if statement included because I don't know where I would implement it. SG is the tab that does NOT require a condition. Because the cells are mixed of which ones need C16 and C20, let's say 1-5 require C15, 6-10 require C20. Thank you!
Sub zxcv()
    Sheets(Array("SG", _
        "sh1", _
        "sh2", _
        "sh3", _
        "sh4", _
        "sh5", _
        "sh6", _
        "sh7", _
        "sh8", _
        "sh9", _
        "sh10")).Select
    Sheets("SG").Activate
    ChDir "C:\Users\mynamehere\Downloads\test"
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
        "C:\Users\mynamehere\Downloads\test\test2.pdf", Quality:=xlQualityStandard, _
        IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
        True
End Sub
 
     
     
    