after watching podcast 1505 and setting up an invoice that advances to the next invoice number, I figured out how to save it as a pdf. Now I'd like to save the invoice with the customer name as well as the invoice number. below is the code I've come up with so far.
Sub nextinvoice()
Range("l3").Value = Range("l3").Value + 1
Range("b15:b31,c15:e30,e10:j11,g15:g30,i15:i30,e8:j8,e12:j13,k15:k30,l31:l33,b35:e37").ClearContents
Sheets("customers").Range("o2").ClearContents
Sheets("cash").Range("e5:j5").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "c:\invoices\" & Range("l3").Value & ".xlsx"
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:="c:\pdf files\" & Range("l3").Value & ".pdf"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
nextinvoice
ActiveWorkbook.Save
End Sub
Thanks in advance
Sub nextinvoice()
Range("l3").Value = Range("l3").Value + 1
Range("b15:b31,c15:e30,e10:j11,g15:g30,i15:i30,e8:j8,e12:j13,k15:k30,l31:l33,b35:e37").ClearContents
Sheets("customers").Range("o2").ClearContents
Sheets("cash").Range("e5:j5").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "c:\invoices\" & Range("l3").Value & ".xlsx"
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:="c:\pdf files\" & Range("l3").Value & ".pdf"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
nextinvoice
ActiveWorkbook.Save
End Sub
Thanks in advance