Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
AJ AJ is offline
external usenet poster
 
Posts: 99
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
AJ AJ is offline
external usenet poster
 
Posts: 99
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
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
Seting a Constant (via code) when creating a new file based on a template Conan Kelly Excel Programming 1 July 15th 05 05:15 PM
Setting a Constant when creating a new file from a template? Conan Kelly Excel Programming 1 July 15th 05 06:10 AM
How do you update a public constant Greg[_16_] Excel Programming 4 February 11th 05 10:34 PM
Template Update Anthony Excel Programming 3 January 29th 05 03:49 PM
A constant update Robert Couchman[_4_] Excel Programming 1 February 18th 04 01:57 PM


All times are GMT +1. The time now is 04:28 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"