I got this code from a MrExcel podcast. It allows you to keep a workbook open, but save a copy of this workbook to a designated folder with a specified name. The way it works now, though, it only saves the first sheet. I need the second sheet to save as well. What do I need to change? I also want to lock the date / time so it doesn't recalculate upon opening the file in the future. I got the little bit of code at the bottom from another post in this forum, but don't know how to implement it. Can anyone help?
Sub NextInvoice()
Range("i8").Value = Range("i8").Value + 1
Range("b6:b12,e6:e9,a20:g27").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook with date/time locked to that date
ActiveSheet.Copy
NewFN = "C:\Users\Chris\Documents\Pawn Shop Invoices\Inv_" & Range("i8").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$I$9" Then Target.Offset(0, 1) = Date
End Sub
Sub NextInvoice()
Range("i8").Value = Range("i8").Value + 1
Range("b6:b12,e6:e9,a20:g27").ClearContents
End Sub
Sub SaveInvWithNewName()
Dim NewFN As Variant
' Copy Invoice to a new workbook with date/time locked to that date
ActiveSheet.Copy
NewFN = "C:\Users\Chris\Documents\Pawn Shop Invoices\Inv_" & Range("i8").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$I$9" Then Target.Offset(0, 1) = Date
End Sub