Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default In VBE, how can I set a date format different than the system date

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default In VBE, how can I set a date format different than the system date

TextBox1.Text = Format(TextBox1.Text, DateFormatString)

--

HTH

Bob

"Alpineskier" wrote in message
...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default In VBE, how can I set a date format different than the system date

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.


"Alpineskier" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving short system date format in VBA RoccoCoetzee Excel Programming 5 September 30th 09 02:45 PM
Convert military date system to standard date system John Weaver Excel Discussion (Misc queries) 8 September 17th 09 06:12 PM
Difference betwen Excel Date () Function and System Date Khalil[_2_] Excel Worksheet Functions 2 June 16th 09 01:10 PM
HOW DO I FORMAT A CELL IN EXCEL TO PICK CURRENT SYSTEM DATE mechi Excel Programming 2 August 17th 07 01:33 PM
Getting the Date Format Being Used By The Operating System And Exc Sunnous Excel Programming 1 November 17th 05 12:33 PM


All times are GMT +1. The time now is 05:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"