I have created a userform for entering data into a list.
Each time the form is opened it automatically generates a reference number
and current date using the code listed below:
My problem is that if the userform is closed without entering data to the
list - the number on the form will still increase (next time opened) - also I
want the userform to be available to a number of users over a network so this
type of counter will not work very well.
Idealy I would like the userform on acitvation to search my list for the
largest number and + 1 to give the new number - is this possible what code
should i use?
Private Sub UserForm_initialize()
counter = GetSetting("XYZ Corp", "issuenum", "count", 0)
counter = counter + 1
SaveSetting "XYZ corp", "issuenum", "count", counter
Range("issuenum") = counter
Range("datelogged") = Now
If IsDate(ActiveCell.Value) Then
Calendar1.Value = DateValue(ActiveCell.Value)
Else
Calendar1.Value = Date
End If
End Sub
P.s - The date code I am using gives dates in the format m/d/y I would
prefer dates in the format d/m/year - how can I do this.
Thanks for any help
Bookmarks