Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Create a function for the next number to be issued

I'm creating a Purchase Order, and I want to have the number increased to the
next number when I open the templet. Any ideas. For example, if the PO is
16500, then the next time I open the file, I want it to be 16501. Can this
function be created?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Create a function for the next number to be issued

This link explains how to do it:

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

Hope this helps.

Pete

On Nov 20, 4:06 pm, David wrote:
I'm creating a Purchase Order, and I want to have the number increased to the
next number when I open the templet. Any ideas. For example, if the PO is
16500, then the next time I open the file, I want it to be 16501. Can this
function be created?


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Create a function for the next number to be issued

You would need VBA


http://www.mcgimpsey.com/excel/udfs/sequentialnums.html




on how to get started with macros


http://www.mvps.org/dmcritchie/excel/getstarted.htm


--


Regards,


Peo Sjoblom


"David" wrote in message
...
I'm creating a Purchase Order, and I want to have the number increased to
the
next number when I open the templet. Any ideas. For example, if the PO
is
16500, then the next time I open the file, I want it to be 16501. Can
this
function be created?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Create a function for the next number to be issued

Peo,

I'm getting a "script out of range" error on line 7 (With ThisWorkbook..

Private Sub Workbook_Open()
Const sAPPLICATION As String = "Excel"
Const sSECTION As String = "Invoice"
Const sKEY As String = "Invoice_key"
Const nDEFAULT As Long = 1&
Dim nNumber As Long
With ThisWorkbook.Sheets("Invoice")
With .Range("B1")
If IsEmpty(.Value) Then
.Value = Date
.NumberFormat = "dd mmm yyyy"
End If
End With
With .Range("B2")
If IsEmpty(.Value) Then
nNumber = GetSetting(sAPPLICATION, sSECTION, sKEY,
nDEFAULT)
.NumberFormat = "@"
.Value = Format(nNumber, "0000")
SaveSetting sAPPLICATION, sSECTION, sKEY, nNumber + 1&
End If
End With
End With
End Sub

"Peo Sjoblom" wrote:

You would need VBA


http://www.mcgimpsey.com/excel/udfs/sequentialnums.html




on how to get started with macros


http://www.mvps.org/dmcritchie/excel/getstarted.htm


--


Regards,


Peo Sjoblom


"David" wrote in message
...
I'm creating a Purchase Order, and I want to have the number increased to
the
next number when I open the templet. Any ideas. For example, if the PO
is
16500, then the next time I open the file, I want it to be 16501. Can
this
function be created?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Create a function for the next number to be issued

Are you using this in a sheet named "Invoice"?


--


Regards,


Peo Sjoblom



"David" wrote in message
...
Peo,

I'm getting a "script out of range" error on line 7 (With ThisWorkbook..

Private Sub Workbook_Open()
Const sAPPLICATION As String = "Excel"
Const sSECTION As String = "Invoice"
Const sKEY As String = "Invoice_key"
Const nDEFAULT As Long = 1&
Dim nNumber As Long
With ThisWorkbook.Sheets("Invoice")
With .Range("B1")
If IsEmpty(.Value) Then
.Value = Date
.NumberFormat = "dd mmm yyyy"
End If
End With
With .Range("B2")
If IsEmpty(.Value) Then
nNumber = GetSetting(sAPPLICATION, sSECTION, sKEY,
nDEFAULT)
.NumberFormat = "@"
.Value = Format(nNumber, "0000")
SaveSetting sAPPLICATION, sSECTION, sKEY, nNumber + 1&
End If
End With
End With
End Sub

"Peo Sjoblom" wrote:

You would need VBA


http://www.mcgimpsey.com/excel/udfs/sequentialnums.html




on how to get started with macros


http://www.mvps.org/dmcritchie/excel/getstarted.htm


--


Regards,


Peo Sjoblom


"David" wrote in message
...
I'm creating a Purchase Order, and I want to have the number increased
to
the
next number when I open the templet. Any ideas. For example, if the
PO
is
16500, then the next time I open the file, I want it to be 16501. Can
this
function be created?








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,560
Default Create a function for the next number to be issued

Yes...I renamed the file "Invoice.xls".

Thanks,

"David" wrote:

Peo,

I'm getting a "script out of range" error on line 7 (With ThisWorkbook..

Private Sub Workbook_Open()
Const sAPPLICATION As String = "Excel"
Const sSECTION As String = "Invoice"
Const sKEY As String = "Invoice_key"
Const nDEFAULT As Long = 1&
Dim nNumber As Long
With ThisWorkbook.Sheets("Invoice")
With .Range("B1")
If IsEmpty(.Value) Then
.Value = Date
.NumberFormat = "dd mmm yyyy"
End If
End With
With .Range("B2")
If IsEmpty(.Value) Then
nNumber = GetSetting(sAPPLICATION, sSECTION, sKEY,
nDEFAULT)
.NumberFormat = "@"
.Value = Format(nNumber, "0000")
SaveSetting sAPPLICATION, sSECTION, sKEY, nNumber + 1&
End If
End With
End With
End Sub

"Peo Sjoblom" wrote:

You would need VBA


http://www.mcgimpsey.com/excel/udfs/sequentialnums.html




on how to get started with macros


http://www.mvps.org/dmcritchie/excel/getstarted.htm


--


Regards,


Peo Sjoblom


"David" wrote in message
...
I'm creating a Purchase Order, and I want to have the number increased to
the
next number when I open the templet. Any ideas. For example, if the PO
is
16500, then the next time I open the file, I want it to be 16501. Can
this
function be created?




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Create a function for the next number to be issued

The sheet that you are using it on has to be called Invoice for the
code to work - not the filename!

Pete

On Nov 21, 12:49 pm, David wrote:
Yes...I renamed the file "Invoice.xls".

Thanks,



"David" wrote:
Peo,


I'm getting a "script out of range" error on line 7 (With ThisWorkbook..


Private Sub Workbook_Open()
Const sAPPLICATION As String = "Excel"
Const sSECTION As String = "Invoice"
Const sKEY As String = "Invoice_key"
Const nDEFAULT As Long = 1&
Dim nNumber As Long
With ThisWorkbook.Sheets("Invoice")
With .Range("B1")
If IsEmpty(.Value) Then
.Value = Date
.NumberFormat = "dd mmm yyyy"
End If
End With
With .Range("B2")
If IsEmpty(.Value) Then
nNumber = GetSetting(sAPPLICATION, sSECTION, sKEY,
nDEFAULT)
.NumberFormat = "@"
.Value = Format(nNumber, "0000")
SaveSetting sAPPLICATION, sSECTION, sKEY, nNumber + 1&
End If
End With
End With
End Sub


"Peo Sjoblom" wrote:


You would need VBA


http://www.mcgimpsey.com/excel/udfs/sequentialnums.html


on how to get started with macros


http://www.mvps.org/dmcritchie/excel/getstarted.htm


--


Regards,


Peo Sjoblom


"David" wrote in message
...
I'm creating a Purchase Order, and I want to have the number increased to
the
next number when I open the templet. Any ideas. For example, if the PO
is
16500, then the next time I open the file, I want it to be 16501. Can
this
function be created?- Hide quoted text -


- Show quoted text -


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
i want to calculate stocks. The percentage issued and value Frank Excel Discussion (Misc queries) 0 August 28th 07 07:06 PM
Shifting Calculated Result - Re-Issued sony654 Excel Worksheet Functions 6 January 15th 06 10:08 AM
How do I create a function to search a range for a number and... NECCExcel Excel Worksheet Functions 2 November 18th 05 09:14 PM
Can software be downloaded to my laptop from CD issued with my n. LDJinLA Excel Discussion (Misc queries) 7 January 20th 05 06:36 PM
Create an Auto Number Metric Excel Worksheet Functions 2 December 1st 04 04:21 PM


All times are GMT +1. The time now is 11:49 AM.

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

About Us

"It's about Microsoft Excel"