Norman_Atkinson
New Member
I have been following a number of tutorials on
creating an invoice,
saving the invoice as pdf,
clearing data from last invoice
opening a new invoice
having the invoice number automatically increase by one.
I have an error in the red row.
I do not know VB so am unable to correct the error. Help would be appreciated.
Thanks
Norman
>>> use code - tags <<<
creating an invoice,
saving the invoice as pdf,
clearing data from last invoice
opening a new invoice
having the invoice number automatically increase by one.
I have an error in the red row.
I do not know VB so am unable to correct the error. Help would be appreciated.
Thanks
Norman
>>> use code - tags <<<
Code:
Sub NextInvoice()
Range("H6").Value = Range("H6").Value + 1
Range("B17:E36").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "C:\David\Inv" & Range("E5").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:"xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
Last edited by a moderator: