

May 29, 2019

Hello again,
I'm looking for solutions to automate our manual invoicing/credit/proforma workbook. I have 200+ worksheets in a workbook and it takes forever to open and close.
At the moment, I have generated a command button where I can save the worksheet as a pdf and file, but it saves as "False.pdf" every time. I thought I was picking up the invoice number by using cell A3 in the code, which is where it lives on the invoice. I would also like to be able to pick up while saving if it is an invoice/credit etc.. the cell is A1 on the invoice and is data validated to a drop-down box. I would appreciate help to figure it out, please.
Sub CommandButton1_Click()
'pdf format
Sheet1.Range("A1:J54").ExportAsFixedFormat x1Typepdf, Filename = "U:\Groups\4. Accounts\Manual Invoice\Manual Invoice pdf 2019.20.1" & Sheet1.Range("A3").Value, openafterpublish:=True
End Sub
In the same command box, I'm looking to go to the next invoice number once the pdf is saved and generated. I have the code for that and it works fine on a separate sheet but not within the command button. Do I need to run this as a separate macro/separate button?


November 8, 2013

Hi Melanie,
I see you have a code for setting the next number, you just need to call the NewInvoice code after you save as pdf:
Sub CommandButton1_Click()
'pdf format
Sheet1.Range("A1:J54").ExportAsFixedFormat x1Typepdf, Filename = "U:\Groups\4. Accounts\Manual Invoice\Manual Invoice pdf 2019.20.1" & Sheet1.Range("A3").Value, openafterpublish:=True
Call NewInvoice
End Sub
1 Guest(s)
