Order Numbers?

Youandih

New Member
Joined
Oct 8, 2013
Messages
7
Good day,

I have a question: I work at a phone retail shop, and we use Excel to make the receipts for our customers.
In order to find the receipts back if there's a problem, we have to (manually!) increase a number, the order number, everytime we open the file.

So, one customer comes, buys something, we make receipt and change the order number to e.g. 000501. We save it, we print it.
Then, the next customer comes, buys something, we make receipt and change order number to 000502, save, print.

Is there a way to automate that process, so that everytime we open the blank receipt, we get a sequential, unique number?

Thanks, Youandi Hoefman
 
Hey guys, I've been using the tips you guys gave me, and they perform perfectly. But now I run into a new problem..

On each receipt, there's a date. I used the =TODAY() function for that.. But now, I find that when I open old receipts, I see today's date..
Makes sense, because I told the sheet to do that; just didn't realize the saved sheet still has that function.

What I need is that, before saving the workbook "BeforePrint", the date (displayed as Oct. 22 2013) must be converted to text. That is possible, I'm sure. But just how does that work?

Now note that I only need the receipt saved as e.g. "1000602" to have the converted text, NOT the original template.
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
In which cell on what sheet is the date? Conversion example:

Code:
With Worksheets("Sheet1").Range("A1")
    .Value = .Value
End With

Change the worksheet and range references to suit.
 
Upvote 0
Like this?:


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Worksheets("Sheet1").Range("B14")
.Value = .Value
End With
ThisWorkbook.SaveAs ("C:\Users\GSMSHOP\Documents\facturen\GSMShop\klanten oktober\" & Range("E14") & ".xls")
End Sub
</pre>
 
Upvote 0
Awesome, I'm going to make a test-sheet today, and test it tomorrow.. I'll keep you posted on any progress.
 
Upvote 0
If you have access to change the date you could change the system date temporarily to test if it worked.
 
Upvote 0

Forum statistics

Threads
1,216,524
Messages
6,131,176
Members
449,629
Latest member
Mjereza

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top