Template Constant Update

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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).
 
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 said:
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 said:
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
 
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 said:
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 said:
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 said:
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
 
Back
Top