I thought this was a minor issue, but if you don't notice it, it changes cells on the other tabs and messes up the workbook. I've already lost most of my formulas.
Why is it doing this? Here is the macro. I've tried changing ActiveWorkbook.SaveAs to ActiveSheet.SaveAs but that didn't work.
Sub NextInvoice()
' Keyboard Shortcut: Ctrl+q
Worksheets.PrintOut _
From:=1, _
To:=1, _
Copies:=1, _
ActivePrinter:="SHARP MX-M365N PCL6"
Dim NewFN As Variant
' Copy Invoice to new workbook
ActiveSheet.Copy
NewFN = "C:\Users\anviladmin\anvilmachine.ca\Document Portal - Documents\Work Orders\" & Range("P6").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
Range("P6").Value = Range("P6").Value + 1
Range("J9, J11, O11:Q11, J12, J15:Q16, J17:Q17, J18:Q28").ClearContents
End Sub
Why is it doing this? Here is the macro. I've tried changing ActiveWorkbook.SaveAs to ActiveSheet.SaveAs but that didn't work.
Sub NextInvoice()
' Keyboard Shortcut: Ctrl+q
Worksheets.PrintOut _
From:=1, _
To:=1, _
Copies:=1, _
ActivePrinter:="SHARP MX-M365N PCL6"
Dim NewFN As Variant
' Copy Invoice to new workbook
ActiveSheet.Copy
NewFN = "C:\Users\anviladmin\anvilmachine.ca\Document Portal - Documents\Work Orders\" & Range("P6").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
Range("P6").Value = Range("P6").Value + 1
Range("J9, J11, O11:Q11, J12, J15:Q16, J17:Q17, J18:Q28").ClearContents
End Sub