Hello all,
I am not an avid use of excel. I am a small business owner (Painting Contractor) and have been trying to make an invoice that works for me. I truly need one that expands as needed but couldn't find any code to do that. I like the new invoice Save and clear in the podcast 1505. It works well with a single page on a sheet however I had to create multiple pages on one worksheet and am now trying to make the podcast 1505 work with it. I'm sure there is a better way to do what I made. I just want to be able to clear the invoice areas save to my file and the register. Below is what I did to do that but there is something wrong for sure, only the file is being saved. Can anyone help me please?
Sub PostToRegster() - This is not working
Dim WS1 As Worksheet
Dim WS2 As Worksheet
Set WS1 = Worksheet("Long Invoice")
Set WS2 = Worksheet("Register")
'Figure out which row
NextRow = WS2.Cells(Row.Count, 1).End(xlUp).Row + 1
'Write the important valuse to Register
WS2.Cells(NextRow, 1).Resize(1, 5).Value = Array(WS1.Range("B6"), WS1.Range("B8"), _
WS1.Range("G1"), WS1.Range("K6"), WS1.Range("H9"))
End Sub
Sub NextInvoice() - This area is in yellow
Range("G1").Value = Range("G1").Value + 1
Range ("A15:J45"), Range("A67:J99"), Range("A120:J152"), Range("A173:J205"), Range("A226:J258"), Range("A279:J311"), Range("A332:J364").ClearContents
End Sub
Sub SaveInvoiceWithNewName() - This is the only thing working right now
Dim NewFN As Variant
'Copy Invoce to a New Workbook
ActiveSheet.Copy
NewFN = "C:\2022 Invoices\Inv" & Range("G1").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub
I am not an avid use of excel. I am a small business owner (Painting Contractor) and have been trying to make an invoice that works for me. I truly need one that expands as needed but couldn't find any code to do that. I like the new invoice Save and clear in the podcast 1505. It works well with a single page on a sheet however I had to create multiple pages on one worksheet and am now trying to make the podcast 1505 work with it. I'm sure there is a better way to do what I made. I just want to be able to clear the invoice areas save to my file and the register. Below is what I did to do that but there is something wrong for sure, only the file is being saved. Can anyone help me please?
Sub PostToRegster() - This is not working
Dim WS1 As Worksheet
Dim WS2 As Worksheet
Set WS1 = Worksheet("Long Invoice")
Set WS2 = Worksheet("Register")
'Figure out which row
NextRow = WS2.Cells(Row.Count, 1).End(xlUp).Row + 1
'Write the important valuse to Register
WS2.Cells(NextRow, 1).Resize(1, 5).Value = Array(WS1.Range("B6"), WS1.Range("B8"), _
WS1.Range("G1"), WS1.Range("K6"), WS1.Range("H9"))
End Sub
Sub NextInvoice() - This area is in yellow
Range("G1").Value = Range("G1").Value + 1
Range ("A15:J45"), Range("A67:J99"), Range("A120:J152"), Range("A173:J205"), Range("A226:J258"), Range("A279:J311"), Range("A332:J364").ClearContents
End Sub
Sub SaveInvoiceWithNewName() - This is the only thing working right now
Dim NewFN As Variant
'Copy Invoce to a New Workbook
ActiveSheet.Copy
NewFN = "C:\2022 Invoices\Inv" & Range("G1").Value & ".xlsx"
ActiveWorkbook.SaveAs NewFN, FileFormat:=xlOpenXMLWorkbook
ActiveWorkbook.Close
NextInvoice
End Sub