Evening everyone,
Firsty i'd like to say thank you for taking the time to read my problem and help me.
Secondly I have tried figuring this problem out myself but my deadline is tomorrow and i am no closer to solving it!!
This is my code and it works perfectly for when the document i wanted to save was only the 3 tabs i had open. My boss now wants these 3 sheets part of larger document (12 sheets!) so now I still need my button to save these 3 sheets as PDF but 2 of them will be hidden (Sheet1, Sheet2) and one will not be hidden (sheet3).
I know there is a way to open the hidden sheets save them and then hide them again, and i have tried a few variations but to be honest i'm stabbing in the dark with it!
Thank you again!
Firsty i'd like to say thank you for taking the time to read my problem and help me.
Secondly I have tried figuring this problem out myself but my deadline is tomorrow and i am no closer to solving it!!
VBA Code:
Private Sub CommandButton3_Click()
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:="U:\sales\Quotes test\2020\May\" & Range("d4") & " " & Range("F1").Value & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
If Application.Sheets("Sheet2").Range("D7").Value = "" Then
MsgBox "Please Insert Quote Reference"
End If
End Sub
This is my code and it works perfectly for when the document i wanted to save was only the 3 tabs i had open. My boss now wants these 3 sheets part of larger document (12 sheets!) so now I still need my button to save these 3 sheets as PDF but 2 of them will be hidden (Sheet1, Sheet2) and one will not be hidden (sheet3).
I know there is a way to open the hidden sheets save them and then hide them again, and i have tried a few variations but to be honest i'm stabbing in the dark with it!
Thank you again!