View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.newusers
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Help with a template file

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




On Mon, 9 Jun 2008 16:56:01 -0700, WiredMike
wrote:

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.