Data Validation in reset cell saved as PDF

starfire

New Member
Joined
Aug 31, 2015
Messages
1
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,:confused: 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
 

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