Hi all,
Back for my second question here.
I have a receipt template I made in Excel 2003....(yes it's old, but so am I and it's all I have)....
I have an invoice number that I want to have change up by one everytime I open the Receipt Template
The cell for the invoice number is F2
I can get the numbers to change ONLY if every time I'm done I save it as another TEMPLATE
I open the template.......it shows number 1498 in cell F2
I fill in all the customers info to the other cells
I normally save the file as a workbook with customers name in a "Completed Charters" folder
Then close the template
Then when I open the TEMPLATE again, I have a fresh blank page to input the next customers info in.
The ONLY way I can get the numbers to go up by 1 is to ONLY "save as" the file as a TEMPLATE again, then close it, then it tells me it will be saved as 1498, next file will be 1499.
I know all I have to do is open the Template and "overwrite" the old customers info with the new info each time, but
that kinda defeats the purpose of having a template to get a fresh blank page open every time.
I'd like to be able to just save the file normally, then close the template and have a new blank sheet open with the next number in sequence.
Am I asking too much.........
Here's what I have in the
ThisWorkbook for code.......
Option Compare Text
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Cancel = True Then Exit Sub
If Not Me.FileFormat = xlTemplate Then Exit Sub
UserForm1.Show
End Sub
Private Sub Workbook_Open()
If Not Me.FileFormat Then Exit Sub
With Sheet2
.Visible = xlSheetVeryHidden
.Range("F2") = .Range("F2")
Sheet2.Range("F2") = .Range("F2") + 1
Me.Save
End With
End Sub
[/URL][/IMG]
Back for my second question here.
I have a receipt template I made in Excel 2003....(yes it's old, but so am I and it's all I have)....

I have an invoice number that I want to have change up by one everytime I open the Receipt Template
The cell for the invoice number is F2
I can get the numbers to change ONLY if every time I'm done I save it as another TEMPLATE
I open the template.......it shows number 1498 in cell F2
I fill in all the customers info to the other cells
I normally save the file as a workbook with customers name in a "Completed Charters" folder
Then close the template
Then when I open the TEMPLATE again, I have a fresh blank page to input the next customers info in.
The ONLY way I can get the numbers to go up by 1 is to ONLY "save as" the file as a TEMPLATE again, then close it, then it tells me it will be saved as 1498, next file will be 1499.
I know all I have to do is open the Template and "overwrite" the old customers info with the new info each time, but
that kinda defeats the purpose of having a template to get a fresh blank page open every time.
I'd like to be able to just save the file normally, then close the template and have a new blank sheet open with the next number in sequence.
Am I asking too much.........

Here's what I have in the
ThisWorkbook for code.......
Option Compare Text
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Cancel = True Then Exit Sub
If Not Me.FileFormat = xlTemplate Then Exit Sub
UserForm1.Show
End Sub
Private Sub Workbook_Open()
If Not Me.FileFormat Then Exit Sub
With Sheet2
.Visible = xlSheetVeryHidden
.Range("F2") = .Range("F2")
Sheet2.Range("F2") = .Range("F2") + 1
Me.Save
End With
End Sub

Last edited: