Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Invoice Numbers | Excel Discussion (Misc queries) | |||
Invoice numbers | Excel Worksheet Functions | |||
invoice numbers | Excel Discussion (Misc queries) | |||
Invoice Numbers | Excel Discussion (Misc queries) | |||
Invoice numbers? | Excel Worksheet Functions |