Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tracy
 
Posts: n/a
Default How can I autonumber in excel?

I have created a Purchase Order form in excel. When the employees use the
template I would like to have the form autonumber. Is this possible?
Thanks
Tracy
  #2   Report Post  
FSt1
 
Posts: n/a
Default

hi,
here is a auto number macro that i wrote sometime back for someone else. but
you can have it too. be sure to read all the comments laced through out the
code.
you will have to do so editing to make it fit your template. if it's not
what you want, post back tomorrow and i'll see if i can fix it.
NOTE: make a back up copy of your template BEFORE you run the macro the
first time.
Regards
FSt1

Sub MacCreatePO()

'Written by FSt1 on or about 3/14/05.

'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.
'Edit PO number address to the place on your PO
template.
Application.CutCopyMode = False 'clears the clipboard
Range("A1:L25").Select 'edit to accommodate the size of your PO template
Selection.Copy
Workbooks.Add
Range("A1").PasteSpecial xlPasteAll
'Edit the file path to where you want to save the PO workbook on your PC
or
'network
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.
'remember...this is a surgical delete. only the data and not the
template.
'the line below should be edited to fit your data.

Range("C5,C6,C8,C9,C10,E5,E6,E8,E9,E10,G5,G7,G8,G9 ,G10,F12,D13,G13").ClearContents
ActiveWorkbook.Save 'save the cleared template workbook with new(next) PO
' number. Ready for next PO
End Sub


"Tracy" wrote:

I have created a Purchase Order form in excel. When the employees use the
template I would like to have the form autonumber. Is this possible?
Thanks
Tracy

  #3   Report Post  
Bernard Liengme
 
Posts: n/a
Default

Do a Google newsgroup search. There are 2000 hits from 1 Jan 2000.
http://groups.google.ca/groups?as_q=... 2005&safe=off
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Tracy" wrote in message
...
I have created a Purchase Order form in excel. When the employees use the
template I would like to have the form autonumber. Is this possible?
Thanks
Tracy



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
VBA for Excel 2000 file is corrupt nkamp Excel Discussion (Misc queries) 0 May 26th 05 03:37 PM
Stop Excel Rounding Dates leinad512 Excel Discussion (Misc queries) 1 April 20th 05 04:19 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
Excel error - Startup (and Acrobat PDFMaker) gxdata Setting up and Configuration of Excel 0 February 4th 05 03:44 AM
Excel 2002 and 2000 co-install. Control Which Starts ? cnuk Excel Discussion (Misc queries) 2 January 17th 05 08:07 PM


All times are GMT +1. The time now is 02:06 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"