Brian,
A re-post of a previous reply.
You could create a workbook name that is incremented on each open. This code
will do this for a name __RefNum__
Private Sub Workbook_Open()
On Error GoTo CleanUp
Application.EnableEvents = False
If IsError(Evaluate("__RefNum__")) Then
Me.Names.Add Name:="__RefNum__", RefersTo:=1
Else
Me.Names.Add Name:="__RefNum__", RefersTo:=Evaluate("__RefNum__") +
1
End If
CleanUp:
Application.EnableEvents = True
End Sub
You would use it in a worksheet like so
=__RefNum__
Just call it whatever suits.
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
Brian said:
I am looking for a formula that adds a sequential number to a file upon
opening. I do not want this formula to do any protection. Any help would
be appreciated.