Thread: Auto Numbering
View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Douglas Douglas is offline
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