I'm currently taking my first steps in learning coding doing this. I want my invoices to have the customer name and then the invoice number. I have been successful in adding those things, however it is always saved like this, (as an example): Invoiceskelsey_12345
How do I make it so the invoices part is gone and I'm only left with kelsey_12345.
This is what I currently have
Sub NextInvoice()
Range("F5").Value = Range("F5").Value + 1
Range("B8").ClearContents
Range("A16:G30").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "C:\Users\DELL\Documents\Invoices" & Range("B8").Value & "_" & Range("F5").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
ActiveWorkbook.Save
NextInvoice
End Sub
How do I make it so the invoices part is gone and I'm only left with kelsey_12345.
This is what I currently have
Sub NextInvoice()
Range("F5").Value = Range("F5").Value + 1
Range("B8").ClearContents
Range("A16:G30").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "C:\Users\DELL\Documents\Invoices" & Range("B8").Value & "_" & Range("F5").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
ActiveWorkbook.Save
NextInvoice
End Sub