View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default how do i set up automatic number generating

Ok, One approach.

paste this macro in the current PO workbook you are using

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)ponum = link to the cell where the PO number is stored
Workbooks.Add
Filename = "NextPOnumber" & ponum + 1
ActiveWorkbook.SaveAs Filename:=Filename
End Sub

Somewhere in the work I imagine you will have the PO number. Edit the line
ponum to point to the cell that contains this number.

The macro will run when you try to save your current bok and it will open a
new book and save it with the file name nextponumber# where # is one more
than the current book.

Was this helpful?
"huwzee" wrote:

i want to set up automatic next number generating for a purchase order spread
sheet