Hello!
I have been trying to find the VBA code for the Mac as it is working well on Windows. Here is the VBA code for Windows:
Sub SaveAsPDF()
Dim strDesktop As String
strDesktop = CreateObject("WScript.Shell").<wbr>SpecialFolders("Desktop")
ThisWorkbook.<wbr>ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=strDesktop & "\invoice " & Format(Date, "mm.dd.yyyy") & ".pdf"
Range("F3").Value = Range("F3").Value + 1
Range("E14:J24").ClearContents
End Sub
This code will save the entire worksheet, I did change ThisWorksbook to ThisActivesheet, but it did not work as I only want to save one active sheet called "Invoice," not the entire worksheet. I would like to know how to save as the PDF on Mac? I also would like to see if it is possible for me to type a filename manually after before I save the PDF. Is it possible to save it under Documents rather than on the desktop? It would be challenging to track invoices if I use to like this invoice 28.09.2018.pdf. I want to input the name company, invoice #, and date. Last, when I close the Excel and open it again, the invoice number will be saved as previous. Is there a way to increment the invoice number when opening the Excel?
Thanks in advance!
I have been trying to find the VBA code for the Mac as it is working well on Windows. Here is the VBA code for Windows:
Sub SaveAsPDF()
Dim strDesktop As String
strDesktop = CreateObject("WScript.Shell").<wbr>SpecialFolders("Desktop")
ThisWorkbook.<wbr>ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=strDesktop & "\invoice " & Format(Date, "mm.dd.yyyy") & ".pdf"
Range("F3").Value = Range("F3").Value + 1
Range("E14:J24").ClearContents
End Sub
This code will save the entire worksheet, I did change ThisWorksbook to ThisActivesheet, but it did not work as I only want to save one active sheet called "Invoice," not the entire worksheet. I would like to know how to save as the PDF on Mac? I also would like to see if it is possible for me to type a filename manually after before I save the PDF. Is it possible to save it under Documents rather than on the desktop? It would be challenging to track invoices if I use to like this invoice 28.09.2018.pdf. I want to input the name company, invoice #, and date. Last, when I close the Excel and open it again, the invoice number will be saved as previous. Is there a way to increment the invoice number when opening the Excel?
Thanks in advance!