Help with a template file

W

WiredMike

Im really new here so apologize if this has been asked before.
My problem is this:

I have created a template file that will be stored on a share drive company
wide.
What I need is something that when someone uses that template, it will
create a unique number in a certain cell and then not change everytime the
new .xls file is opened.
I would like to have that number pull from 3 cells if possible.

I do understand a little bit about macros from what I have learned from this
discussion group. But please if its really complicated help me with step by
step.

Thank You
 
S

sb1920alk

A unique number? Like a timestamp, or something else? What is in the 3 cells
that it "pulls from"? I believe timestamps require either macros or circular
references. If you use macros your users will generally have to click,
"Enable Macros" every time they open it. If you use a circular reference, you
will have to check the Iterations box on the Tools->Options->Calculations
tab. This can be saved with the file, but it is set by the first Excel file
that opens. So if Excel is closed, and they open your file containing
circular references, everything's file. But it they open a different file
who's Iterations box is not checked, then open your file without exiting
Excel first, they will can a circular reference error.

My advice is to decide which way you want to go and describe in greater
detail what the number should be for each file.
 
W

WiredMike

It will pull from a cell containing the date, a part number, and a detail
number.
Example: 322200894861 3/22/2008 is the date 948 is the part number and 61
is the detail number.
This information will all go into one cell. After the first user completely
fills out the rest of the sheet. He will be sending the file to other users
in the company. This is where I need to keep the information the same no
matter how many times the file is opened.
 
G

Gord Dibben

Mike

Dave Peterson posted this a while back.

If the workbook has never been saved, which is the case with a newly created
workbook from the Template, the invoice number will increment.

After saving, the number will not increment when opening that saved workbook.

Private Sub Workbook_Open()
if thisworkbook.path = "" then
'it's never been saved, so increment
Sheet1.Range("H16").Value = Sheet1.Range("H16").Value + 1
end if
End Sub

Incorporate into your macro.

For more on creating the unique number see some more code here................

http://tinyurl.com/3g6g65



Gord Dibben MS Excel MVP
 
S

sb1920alk

So you want this data (322200894861) to be entered in a cell automatically,
and once it's entered, not to be changed? Well, I still say you will need
either macors or circular references for this effect. You could do it
manually by typing the number in then protecting the worksheet....

So, what should the file look for to trigger poplating the cell? Will it be
only one cell, or a column of cells, one populating after the other?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top