Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatted Date 1

Status
Not open for further replies.

randy700

Programmer
Sep 25, 2003
2,384
US

Excel 2007

I have this code:
Code:
Dim dtMonthEnd as Date
dtMonthEnd = Format(#4/30/11#, "mm/dd/yy")

The result I'm getting is Month end = 4/30/11

I'm moving this to a mainframe file and need 04/30/11. The leading zero is important on the mainframe.

Anyone know how I can get it formatted as needed?



Randy
 
Dim dtMonthEnd as String

(but I'd advise you read up on dates and how they are stored and displayed so as to get an understanding on what is going on here)
 
Of course.
I knew I was missing something obvious.
Thanks, strongm.

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top