Here is some old code that should do the trick (the counter is saved on HD
as a microscopic text file):
Function TransacNumber() As Long
Dim Storage As String
Dim Storagefile As String
Storagefile = "C:\Egen\Nummer.num" 'the file
If Dir(Storagefile) = "" Then
TransacNumber = 0
Else
Open Storagefile For _
Input Access Read As #1
While Not EOF(1)
Line Input #1, Storage
TransacNumber = Val(Storage)
Wend
Close #1
End If
TransacNumber = TransacNumber + 1
Open Storagefile For _
Output Access Write As #1
Print #1, TransacNumber
Close #1
End Function
Sub test()
MsgBox "This is transaction number " & _
TransacNumber
End Sub
I can not tell you where to place it, because I don't really know when you
want to renumber and what happens before that... The thisworkbook
before_save will renumber /before/ saving, probably not a good idea.
Best wishes Harald
CiaraG <ciara.g...@uk.pwcglobal.com> skrev i
news:01c00138$4c905e60$3122...@UK679621.gbcoopers.com...