Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I want to generate a new number sequentially everytime I open my excell
document. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Cannot even remember where I got this, but hey, it works like a charm!
Private Sub Workbook_Open() Const sAPpplicationAs String = "Excel" Const sSectionAs String = "Quote" Const sKey As String = "Quotation_key" Const nDefault As Long = 1& Dim nQuotNumber As Long With ThisWorkbook.Sheets("Quotation") With .Range("Number") If Not IsEmpty(.Value) Then nQuotNumber = Range("Number") SaveSetting sApplication, sSection, sKey, nQuotNumber + 1& End If End With With .Range("Number") If IsEmpty(.Value) Then nquotNumber = GetSetting(sApplication, sSection, sKey, nDefault) .NumberFormat = "@" .Value = Format(nquotNumber, "0000") SaveSetting sAPpplication, sSection, sKey, nquotNumber + 1& End If End With End With End Sub "housedoc" wrote: I want to generate a new number sequentially everytime I open my excell document. |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you i will try it.
"kassie" wrote: Cannot even remember where I got this, but hey, it works like a charm! Private Sub Workbook_Open() Const sAPpplicationAs String = "Excel" Const sSectionAs String = "Quote" Const sKey As String = "Quotation_key" Const nDefault As Long = 1& Dim nQuotNumber As Long With ThisWorkbook.Sheets("Quotation") With .Range("Number") If Not IsEmpty(.Value) Then nQuotNumber = Range("Number") SaveSetting sApplication, sSection, sKey, nQuotNumber + 1& End If End With With .Range("Number") If IsEmpty(.Value) Then nquotNumber = GetSetting(sApplication, sSection, sKey, nDefault) .NumberFormat = "@" .Value = Format(nquotNumber, "0000") SaveSetting sAPpplication, sSection, sKey, nquotNumber + 1& End If End With End With End Sub "housedoc" wrote: I want to generate a new number sequentially everytime I open my excell document. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
lost all excell files | Excel Discussion (Misc queries) | |||
Can I view an excell document without excell (not installed wit. | Excel Discussion (Misc queries) | |||
insert query into excell sheet to update excell sheet and pivot table | Excel Discussion (Misc queries) | |||
Can I view an excell document without excell (not installed wit. | Excel Discussion (Misc queries) | |||
lable ranges in Excell | Excel Discussion (Misc queries) |