Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Invoice Numbers - Please Help!

This is all new to me so please be patient! lol

What I'm trying to do is to have automatic advancing invoice numbers in my
template. I'm using Excel 2003. This is what I've tried and just can't get
it to work. Any help would be appreciated. Thank you.

Private Sub Workbook_Open()
Const DEFAULTSTART As Integer = 1000
Const MYAPPLICATION As String = "Excel"
Const MYSECTION As String = "Wardinvoice2"
Const MYKEY As String = "Wardinvoice2Key"
Const MYLOCATION As String = "E5"
Dim regValue As Long

With ThisWorkbook.Sheets(1).Range(MYLOCATION)
If .Text < "" Then Exit Sub
regValue = GetSetting(MYAPPLICATION, MYSECTION, MYKEY,
DEFAULTSTART)
.Value = CStr(regValue)
SaveSetting MYAPPLICATION, MYSECTION, MYKEY, regValue + 1
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Invoice Numbers - Please Help!

What does "can't get it to work" mean?

The code appears to be fine if stored in a template file with E5 blank.
Workbooks created from that template will have increasing serial numbers.


In article ,
sherriq wrote:

This is all new to me so please be patient! lol

What I'm trying to do is to have automatic advancing invoice numbers in my
template. I'm using Excel 2003. This is what I've tried and just can't get
it to work. Any help would be appreciated. Thank you.

Private Sub Workbook_Open()
Const DEFAULTSTART As Integer = 1000
Const MYAPPLICATION As String = "Excel"
Const MYSECTION As String = "Wardinvoice2"
Const MYKEY As String = "Wardinvoice2Key"
Const MYLOCATION As String = "E5"
Dim regValue As Long

With ThisWorkbook.Sheets(1).Range(MYLOCATION)
If .Text < "" Then Exit Sub
regValue = GetSetting(MYAPPLICATION, MYSECTION, MYKEY,
DEFAULTSTART)
.Value = CStr(regValue)
SaveSetting MYAPPLICATION, MYSECTION, MYKEY, regValue + 1
End With
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Invoice Numbers - Please Help!

E5 is blank in the template file, but it won't advance past 1000. Any ideas
what I might have done wrong?

"JE McGimpsey" wrote:

What does "can't get it to work" mean?

The code appears to be fine if stored in a template file with E5 blank.
Workbooks created from that template will have increasing serial numbers.


In article ,
sherriq wrote:

This is all new to me so please be patient! lol

What I'm trying to do is to have automatic advancing invoice numbers in my
template. I'm using Excel 2003. This is what I've tried and just can't get
it to work. Any help would be appreciated. Thank you.

Private Sub Workbook_Open()
Const DEFAULTSTART As Integer = 1000
Const MYAPPLICATION As String = "Excel"
Const MYSECTION As String = "Wardinvoice2"
Const MYKEY As String = "Wardinvoice2Key"
Const MYLOCATION As String = "E5"
Dim regValue As Long

With ThisWorkbook.Sheets(1).Range(MYLOCATION)
If .Text < "" Then Exit Sub
regValue = GetSetting(MYAPPLICATION, MYSECTION, MYKEY,
DEFAULTSTART)
.Value = CStr(regValue)
SaveSetting MYAPPLICATION, MYSECTION, MYKEY, regValue + 1
End With
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Invoice Numbers - Please Help!

Not really. It works fine for me in both MacXL and XL03.

It sounds like the SaveSetting is not writing to the registry for some
reason.

In article ,
sherriq wrote:

E5 is blank in the template file, but it won't advance past 1000. Any ideas
what I might have done wrong?

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
Invoice Numbers hilltopper_lady Excel Discussion (Misc queries) 3 December 17th 06 06:01 AM
Invoice numbers cdixon Excel Worksheet Functions 1 October 8th 05 01:03 AM
invoice numbers Murphey's Law Excel Discussion (Misc queries) 8 August 5th 05 05:22 PM
Invoice Numbers Russ Excel Discussion (Misc queries) 1 January 29th 05 05:55 PM
Invoice numbers? Missie Excel Worksheet Functions 1 December 13th 04 07:28 AM


All times are GMT +1. The time now is 10:19 PM.

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"