I've been losing sleep because of these problems. I created an invoice template (macro-enabled) that is designed to be automated: meaning, you can increase/decrease invoice number, auto save features and auto-fill other data once a name is selected.
1) VBA to auto-save then create new xls file doesn't work - - always error something. I have created a button, supposed to be to make this run and easier for the user, who doesn't know much about Excel. Please let me know what's wrong
- Code: Select all
Dim NewFN As Variant
' Copy Invoice to a new workbook
ActiveSheet.Copy
NewFN = "C:kinahcareInv" & Range("G4").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
2) The invoice itself, gets info from another sheet called 'clients'. I created dummy columns where the VLOOKUP results would go then, link it to the invoice. This too did not work! Please let me know what's wrong, too.
This is one of the VLOOKUPs I did to extract the Code Nr of the client
- Code: Select all
[code]
Thank you in advance for your help!!