MrExcel Publishing
Your One Stop for Excel Tips & Solutions

How to display recent date on userform..


Posted by Joobor on August 01, 2001 8:39 AM

Hello again,

I have trying attached label and textbox at the userform..and
i put the formula =now at the label and textbox but when the userform
appeared..it show the formula..=now..any ideas to show the dates
with my format : dd/mmm/yyyy time and some text like my name
i.e.

02 aug 2001 2.10 AM Igor Love You

many thanks


Posted by faster on August 01, 2001 10:24 AM

'try this
'paste the code in the form's code

Private Sub UserForm_Activate()
TextBox1.Text = Now & " Igor Love You"
End Sub

Posted by Cory on August 01, 2001 10:28 AM

Don't add your formulas to the "caption", "value", or "text" properties. Instead, right-click on your userform in the VBE and pick viewcode. When the code box comes up, change the "Click" event to "Activate" then try this code:

Label1.Caption = "The time is " & Now
TextBox1.Value = Date
TextBox1.Value = Format(TextBox1.Value, "dd/mm/yyyy")