#1   Report Post  
Excel Man
 
Posts: n/a
Default Auto Numbering

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks
  #2   Report Post  
FSt1
 
Posts: n/a
Default

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #3   Report Post  
Excel Man
 
Posts: n/a
Default

THANKS, WORKS GREAT

"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #4   Report Post  
chris w
 
Posts: n/a
Default

This sound exactly what I need. How can I use the code? I am getting syntax
errors on the copy and paste. Unfortunatly I have done limited code writing,
mostly creating macros, so Im slow.

"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #5   Report Post  
FSt1
 
Posts: n/a
Default

hi,
you shouldn't be having errors if you made all the changes.
did you?

regards
FSt1

"chris w" wrote:

This sound exactly what I need. How can I use the code? I am getting syntax
errors on the copy and paste. Unfortunatly I have done limited code writing,
mostly creating macros, so Im slow.

"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks



  #6   Report Post  
chris w
 
Posts: n/a
Default

I made the change to the line to show

ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\Owner\My
Documents\PO" & n &".xls"_

where am I wrong? should the & n & be replaced with somthing?

"FSt1" wrote:

hi,
you shouldn't be having errors if you made all the changes.
did you?

regards
FSt1

"chris w" wrote:

This sound exactly what I need. How can I use the code? I am getting syntax
errors on the copy and paste. Unfortunatly I have done limited code writing,
mostly creating macros, so Im slow.

"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #7   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 590
Default Auto Numbering

Where do I start with the
MacCreatePO() command?


"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Auto Numbering

I have an Excel file that was created by someone else to address rejection
tags and I need to auto number in cell M2, i.e. Rejection Tag Number. Is this
possible?

"Ken" wrote:

Where do I start with the
MacCreatePO() command?


"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default Auto Numbering

Your problem seems similar to mine - hope youcan help.
By default the number I type in a cell should stay the same once I enter it
- e.g.
when I type in 19 and press Enter the figure in the cell should still read 19.
However it changes to 0.19. Do you know how to rectify this problem/
Douglas
"FSt1" wrote:

hi,
you shouldn't be having errors if you made all the changes.
did you?

regards
FSt1

"chris w" wrote:

This sound exactly what I need. How can I use the code? I am getting syntax
errors on the copy and paste. Unfortunatly I have done limited code writing,
mostly creating macros, so Im slow.

"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 620
Default Auto Numbering

Tools/ Options/ Edit
Uncheck: Fixed Decimal Places
--
David Biddulph

"Douglas" wrote in message
...
...
By default the number I type in a cell should stay the same once I enter
it
- e.g.
when I type in 19 and press Enter the figure in the cell should still read
19.
However it changes to 0.19. Do you know how to rectify this problem/





  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Auto Numbering

I recently ran across this post and it is helping me with my PO template.
The problem I'm having is that when the file autosaves and I open the saved
file, I loss all my column width formatting.
I know very little about programing, but I am wondering if it is the
fileformat:= xlnormal that is resetting the column widths to the default
settings.
Please let me know.

Thanks

"FSt1" wrote:

hi,
I wrote this for someone a few months back. it was for pruchase Orders so
you may have to make a few changes but it will do the same for you.
Post back if you have problems.

Sub MacCreatePO()

'Creates a new PO(purchase order) workbook, saving the created PO workbook
with
'the PO number as part of the file name. Leaves the "template" PO workbook
"as is".
'macCreatePO should be triggered from a button on the PO Template sheet.

Dim n As Range
Set n = Range("A1") ' the all important PO number. change if needed
'to a place in the PO template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'change to accommodate the size of the PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'change the file path to where you want to save the PO workbook
ActiveWorkbook.SaveAs Filename:="H:\CodeStuff\PO" & n & ".xls" _
FileFormat:= xlNormal, Password:="", WriteResPassword:="" _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
Cells(1, 1).Select 'go and park at cell A1 and wait
MsgBox ("Purchase Order was saved as PO" & n & ".xls")
n.Value = n.Value + 1 'add 1 to old PO number for new PO number
'change the place of the date to add. Macro puts today's date
'in but this can be edited.
Range("I1") = Date
'clear the contents of the old PO to set up the next PO. clear
surgically so
'to leave template in tact. more clearContents commands may be needed.
'Range("need areas to clear here").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new
'(next) POnumber.
'Ready for next PO
End Sub

regards

FSt1
"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

  #12   Report Post  
Posted to microsoft.public.excel.misc
DP DP is offline
external usenet poster
 
Posts: 58
Default Auto Numbering

Were you able to get this to work? It's exactly what I'm looking for but not
sure exactly where to place the code in Excel and what modifications I need
to make. can you help?

"Excel Man" wrote:

I want my invoices to automatically go up in number. EX. Invoice 1, Invoice
2...
I want this to happen every time I open my template to create a new invoice.
I can't remember how to do this. Can anyone provide me with an answer?
Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Numbering Each Cell In A Column UFWPresident Excel Worksheet Functions 5 June 17th 05 12:18 AM
Auto numbering of spreadsheets abfabrob Excel Discussion (Misc queries) 1 May 9th 05 03:09 PM
Auto page numbering for several worksheets Andy Excel Worksheet Functions 1 March 13th 05 04:41 AM
auto numbering Tricky Nicky Excel Discussion (Misc queries) 2 December 29th 04 05:44 PM
AUTO PAGE NUMBERING DIFFERENTLY FOR A WORKBOOK CHCO Excel Worksheet Functions 0 December 13th 04 04:11 PM


All times are GMT +1. The time now is 10:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"