I am trying to save an invoice file as the invoice number (H9) and the customer name (H2). I found this in a different post on here:
Sub SaveInvoiceWithNewName()
Dim NewFN As Variant
' Copy Invoice to a New Workbook
ActiveSheet.Copy
NewFN = "C:\aaa\Inv" & Range("E5").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
And it works after C:\.... and E5 are changed to fit mine.
But I would like the file name to be H9,H2.xlsx [EX: 24568,Mike Jones.xlsx] not just H9.xlsx
Thanks for the help.
Dim NewFN As Variant
' Copy Invoice to a New Workbook
ActiveSheet.Copy
NewFN = "C:\aaa\Inv" & Range("E5").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
And it works after C:\.... and E5 are changed to fit mine.
But I would like the file name to be H9,H2.xlsx [EX: 24568,Mike Jones.xlsx] not just H9.xlsx
Thanks for the help.