Apologies if this is in the wrong place, or has been asked before.
i am trying to create code to enable me to have a sheet that would enable the user to automatically save as PDF, but only if the cell B6 is completed, this is the code i have. This asks for B6 to be completed but will then go on to save.
Or, if possible i would like it to be sent as PDF email
Private Sub workbook_beforeclose(cancel As Boolean)
Sub SaveAsPDF()
'
' SaveAsPDF Macro
Range("a1:f48").Select
ActiveCell.FormulaR1C1 = "."
If Cells("6,2").Value = "" Then
MsgBox "Please complete Cell B6"
cancel = True
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, fileName:= _
"C:\Users\Steve\Desktop\Request to Change an Order_v1 0 RV (2)(AutoRecovered)1.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End If
End Sub
any help would be appreciated
thanks
i am trying to create code to enable me to have a sheet that would enable the user to automatically save as PDF, but only if the cell B6 is completed, this is the code i have. This asks for B6 to be completed but will then go on to save.
Or, if possible i would like it to be sent as PDF email
Private Sub workbook_beforeclose(cancel As Boolean)
Sub SaveAsPDF()
'
' SaveAsPDF Macro
Range("a1:f48").Select
ActiveCell.FormulaR1C1 = "."
If Cells("6,2").Value = "" Then
MsgBox "Please complete Cell B6"
cancel = True
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, fileName:= _
"C:\Users\Steve\Desktop\Request to Change an Order_v1 0 RV (2)(AutoRecovered)1.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End If
End Sub
any help would be appreciated
thanks