In VBE, how can I set a date format different than the system date

  • Thread starter Thread starter Alpineskier
  • Start date Start date
A

Alpineskier

I have a date format stored in a string and want to format a date in a text
box on a userform the same as my DateFormatString.
 
Hi,

Try this

Dim MyString As String
MyString = "yyyy/mm/dd"
TextBox1.Text = Format(Date, MyString)

or for another date

Mydate = #3/11/2000#
Dim MyString As String
MyString = "dd mmmm yyyy"
TextBox1.Text = Format(Mydate, MyString)
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top