ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   converting 'TODAY' into dd-mmm-yy format (https://www.excelbanter.com/excel-programming/292789-converting-today-into-dd-mmm-yy-format.html)

neowok[_24_]

converting 'TODAY' into dd-mmm-yy format
 
I have the following code which converts some textbox text into the
format i need

mydatestr = Format(CDate(TextBox2.Text), "dd-mmm-yy")

what i also need is to get todays date and put that into the same
format as well but substituting textbox2.text for TODAY doesnt seem to
work.


---
Message posted from http://www.ExcelForum.com/


Norman Harker

converting 'TODAY' into dd-mmm-yy format
 
Hi neowok!

Use:
mydatestr = Format(Date, "dd-mmm-yy")

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
"neowok " wrote in message
...
I have the following code which converts some textbox text into the
format i need

mydatestr = Format(CDate(TextBox2.Text), "dd-mmm-yy")

what i also need is to get todays date and put that into the same
format as well but substituting textbox2.text for TODAY doesnt seem

to
work.


---
Message posted from
http://www.ExcelForum.com/




Tom Ogilvy

converting 'TODAY' into dd-mmm-yy format
 
In VBA, DATE is equivalent to Today in the worksheet

mydatestr1 = Format(CDate(Date), "dd-mmm-yy")

--
Regards,
Tom Ogilvy


"neowok " wrote in message
...
I have the following code which converts some textbox text into the
format i need

mydatestr = Format(CDate(TextBox2.Text), "dd-mmm-yy")

what i also need is to get todays date and put that into the same
format as well but substituting textbox2.text for TODAY doesnt seem to
work.


---
Message posted from http://www.ExcelForum.com/




neowok[_25_]

converting 'TODAY' into dd-mmm-yy format
 
nice that worked.

thank

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 08:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com