Userform to have Last Updated Values Time & Date Displayed ??

C

Corey

I have a Userform that displays several values, and asks for an update of
the values.
The user may update them or leave them blank for No Changes to the Values.

What i want to do is place a comment or Label that displays on the userform,
the previous time and date the values(at least 1) was modified/updated.

How can i do this?

Do i add a Label or a Text Box ?
And how would i code that to suit this?

Corey....
 
C

Corey

Currently i do not store any times/dates for the running or modifying of
this u/form or values on it.
How do i set that up 1st?
Corey....
 
M

Martin Fishlock

In your data work sheet add a column/cell for last updated and set the
default to say 1/1/1990.

Then you add a label to the user form and set the label to the last updated
value.
you need to do this in the userform_initialize event

eg

datelastupdated=worksheets("sheet1").range("A1")
'cell where last update is
if datelastupdated <> #01/01/1990# then
me.labellastupdate="Last updated: at " & format( _
datelastupdated , "Hh:Nn ""on"" dd/mm/yyyy")
end if

unless the form is bound to data in which case you need to bind the label to
the data (not sure if that is possible, may need a text box in that case (but
can set it to fixed)).
 
Top