automatic invoice numbering

pennyross

New Member
Joined
Jul 22, 2005
Messages
9
I have a invoice that I made in excel. I am now at he point of doing the invoice number in which every time I start a new invoice I need the # to increase 1 number up from the last. I am new at excel and please please as simply as possible. I have tried some on the message board already and will not work for me.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
no I have not tried this one, but I sure will. May I ask where does this code get placed? Maybe a silly ? because I have set up the rest of the Invoice.
 
Upvote 0
Open your workbook and click the XL icon to the left of File on the menu. Paste the code into the window on the right. Press Alt+F11 to return to your workbook. Save it as a template (xlt) in the location Excel suggests. When you want to create an invoice choose File|New and choose the template.
 
Upvote 0
I am putting in the code that I need to use for my invoice. But the one section for the keeps coming up red and saying windows finds a problem with it the code is *** Change range reference to suit *** any sugestions.
 
Upvote 0
auto numbering a cell

Here is the code I am using.
Private Sub Workbook_Open ( )
Dim Fname As String
Dim FNo As String
FName = Application.Path & Application.PathSeparator & "Number.Txt"
FNo = Freefile
x = 0
On Error Resume Next
Open FName For Input As #FNo
Input #FNo, x
x = x + 1
*** Change range reference to suit ***
Range ("AA2") .Value = x
Close #FNo
FNo = FreeFile
Open FName For output As #FNo
Write #1, x
Close #FNo
End Sub

When I enter ***Change range reference to suit*** Turns Red
this message appears (Compile Error)
Any Suggestions.
 
Upvote 0
That's a comment and should have a single quote in front of it:

'*** Change range reference to suit ***

Or you can delete the line.
 
Upvote 0
Open your workbook and click the XL icon to the left of File on the menu. Paste the code into the window on the right. Press Alt+F11 to return to your workbook. Save it as a template (xlt) in the location Excel suggests. When you want to create an invoice choose File|New and choose the template.

The only problem with that is when the invoice is saved as an .xls file, each time the invoice is opened, the number will increase.
I doubt that this will be acceptable.

Have a look at these :-

http://www.mrexcel.com/board2/viewtopic.php?t=209988&start=0

http://www.mrexcel.com/board2/viewtopic.php?t=67922&highlight=insertnextseqnbr
 
Upvote 0

Forum statistics

Threads
1,225,151
Messages
6,183,197
Members
453,151
Latest member
Lizamaison

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