Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Template Constant Update
Hello
I have a workbook which has sequential numbering as per the code below: Private Sub workbook_Open() worksheets("FORM").Range("K2") = worksheets("FORM").Range("K2") + 1 End Sub My question is if I use this workbook as a template with data tracking, how can I keep the sequential numbering to go on once I have saved it as xlt. Thanks in advance for a reply/solution AJ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Template Constant Update
You would need to store your seqential number somewhere outside the workbook,
such as in the registry. The correct answer will depend on how you are going to use the template (is it on a shared drive or only accessed from one computer? Will there each number be unique amongst all users [a number is used once only] or unique to each user [each user can use a number once] and so forth). -- Regards, Tom Ogilvy "AJ" wrote: Hello I have a workbook which has sequential numbering as per the code below: Private Sub workbook_Open() worksheets("FORM").Range("K2") = worksheets("FORM").Range("K2") + 1 End Sub My question is if I use this workbook as a template with data tracking, how can I keep the sequential numbering to go on once I have saved it as xlt. Thanks in advance for a reply/solution AJ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Template Constant Update
The template is on a shared drive used by one computer. The number is Unique
among all users (if any). Thanks for your reply and appreciate to see a solution. "Tom Ogilvy" wrote: You would need to store your seqential number somewhere outside the workbook, such as in the registry. The correct answer will depend on how you are going to use the template (is it on a shared drive or only accessed from one computer? Will there each number be unique amongst all users [a number is used once only] or unique to each user [each user can use a number once] and so forth). -- Regards, Tom Ogilvy "AJ" wrote: Hello I have a workbook which has sequential numbering as per the code below: Private Sub workbook_Open() worksheets("FORM").Range("K2") = worksheets("FORM").Range("K2") + 1 End Sub My question is if I use this workbook as a template with data tracking, how can I keep the sequential numbering to go on once I have saved it as xlt. Thanks in advance for a reply/solution AJ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Template Constant Update
You could have it read and write information to a text file at a specific
location on the shared drive. Or if it will only be used on one computer, you can use the getsetting and savesetting commands to read and write a value to the registry. these are very simple to use and explained well in the Excel VBA help. Just put code to use them in the workbook_open event of the template. -- Regards, Tom Ogilvy "AJ" wrote: The template is on a shared drive used by one computer. The number is Unique among all users (if any). Thanks for your reply and appreciate to see a solution. "Tom Ogilvy" wrote: You would need to store your seqential number somewhere outside the workbook, such as in the registry. The correct answer will depend on how you are going to use the template (is it on a shared drive or only accessed from one computer? Will there each number be unique amongst all users [a number is used once only] or unique to each user [each user can use a number once] and so forth). -- Regards, Tom Ogilvy "AJ" wrote: Hello I have a workbook which has sequential numbering as per the code below: Private Sub workbook_Open() worksheets("FORM").Range("K2") = worksheets("FORM").Range("K2") + 1 End Sub My question is if I use this workbook as a template with data tracking, how can I keep the sequential numbering to go on once I have saved it as xlt. Thanks in advance for a reply/solution AJ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Seting a Constant (via code) when creating a new file based on a template | Excel Programming | |||
Setting a Constant when creating a new file from a template? | Excel Programming | |||
How do you update a public constant | Excel Programming | |||
Template Update | Excel Programming | |||
A constant update | Excel Programming |