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:Groups4. AccountsManual InvoiceManual 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?
Hi Melanie,
Can you prepare a sample file with your code? It will be easier to evaluate what you have or generating the next numbers and saving to pdf.
Hi Catalin
Thanks for getting back to me. I'm not having much luck in inserting a link for you, it keeps coming up blocked.
Can I reply to the email instead?
Try simplifying your file and upload it here directly, no links needed.
Aha! Found the bit to upload.
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:Groups4. AccountsManual InvoiceManual Invoice pdf 2019.20.1" & Sheet1.Range("A3").Value, openafterpublish:=True
Call NewInvoice
End Sub
Hi Catalin,
I can't believe that's all that was missing! Thank you so much for your help, working a charm now - just need to take the plunge and go "live"