Let me start by sating I'm fairly versed in Excel, and have been trying to figure this out and searching for an answer for almost a week,
so any help at all would be GREATLY appreciated!
I found these two codes (the top two) in the forums, but can't seem to get it to work while saving as a PDF. I'm pretty sure it's because I'm using merged cells. I'd "unmerge" the cells if I could, but that unfortunately isn't an option. My code is on the bottom.
Thank you again in advance!!!!!
(CODE 1)
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
If [Z1] = "" then
Cancel = True
Thisworkbook.saved = True
Else
[Z1] = ""
End if
End Sub
(CODE 2)
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Sheets("Sheet1").Cells(1, 1) = "first option"
Sheets("Sheet1").Cells(2, 2) = "first option in the next list"
End Sub
(MY CODE)
Sub NEXTINVOICE()
Range("b13:b22,d13:d19,d21:d22,f13:f21").ClearContents
End Sub
Sub resetdatavalidation()
[A5:A5].Value = [B1].Value
[A6:A6].Value = [Q1].Value
End Sub
Sub SaveInvAsPDF()
NewFN = "C:\Invoices\Customer " & Range("F22").Value & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
NewFN = "D:\aaa\Inv " & Range("F22").Value & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
NEXTINVOICE
End Sub

I found these two codes (the top two) in the forums, but can't seem to get it to work while saving as a PDF. I'm pretty sure it's because I'm using merged cells. I'd "unmerge" the cells if I could, but that unfortunately isn't an option. My code is on the bottom.
Thank you again in advance!!!!!
(CODE 1)
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
If [Z1] = "" then
Cancel = True
Thisworkbook.saved = True
Else
[Z1] = ""
End if
End Sub
(CODE 2)
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Sheets("Sheet1").Cells(1, 1) = "first option"
Sheets("Sheet1").Cells(2, 2) = "first option in the next list"
End Sub
(MY CODE)
Sub NEXTINVOICE()
Range("b13:b22,d13:d19,d21:d22,f13:f21").ClearContents
End Sub
Sub resetdatavalidation()
[A5:A5].Value = [B1].Value
[A6:A6].Value = [Q1].Value
End Sub
Sub SaveInvAsPDF()
NewFN = "C:\Invoices\Customer " & Range("F22").Value & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
NewFN = "D:\aaa\Inv " & Range("F22").Value & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=NewFN, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
NEXTINVOICE
End Sub