Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default change datestamp from yyyy-mm-dd to yymmdd

I have an auto inserted datestamp when I open a workbook. The dateformt
is yyyy-mm-dd (example: 2004-07-22), and I wonder if there are any way
to convert it to yymmdd (example: 040722)?
Here's the VBA source I use to get the datestamp:

Private Sub Workbook_Open()
If Sheets("dayreport").Range("T5") = "" Then
Sheets("dayreport").Range("T5") = Date
Else
End If
End Sub

--
//Jst
Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default change datestamp from yyyy-mm-dd to yymmdd

Hi

You can use the format function
MsgBox Format(Now, "yymmdd")



--
Regards Ron de Bruin
http://www.rondebruin.nl


"jst_se" wrote in message ...
I have an auto inserted datestamp when I open a workbook. The dateformt
is yyyy-mm-dd (example: 2004-07-22), and I wonder if there are any way
to convert it to yymmdd (example: 040722)?
Here's the VBA source I use to get the datestamp:

Private Sub Workbook_Open()
If Sheets("dayreport").Range("T5") = "" Then
Sheets("dayreport").Range("T5") = Date
Else
End If
End Sub

--
//Jst
Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default change datestamp from yyyy-mm-dd to yymmdd

Hi
try
Private Sub Workbook_Open()
with Sheets("dayreport").Range("T5")
If .value = "" Then
.value = Date
.numberformat="YYMMDD"
End If
end with
End Sub


--
Regards
Frank Kabel
Frankfurt, Germany

"jst_se" schrieb im Newsbeitrag
...
I have an auto inserted datestamp when I open a workbook. The

dateformt
is yyyy-mm-dd (example: 2004-07-22), and I wonder if there are any

way
to convert it to yymmdd (example: 040722)?
Here's the VBA source I use to get the datestamp:

Private Sub Workbook_Open()
If Sheets("dayreport").Range("T5") = "" Then
Sheets("dayreport").Range("T5") = Date
Else
End If
End Sub

--
//Jst
Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default change datestamp from yyyy-mm-dd to yymmdd

Thank you, Frank! That works just fine :)

Frank Kabel wrote:

Hi
try
Private Sub Workbook_Open()
with Sheets("dayreport").Range("T5")
If .value = "" Then
.value = Date
.numberformat="YYMMDD"
End If
end with
End Sub


--
Regards
Frank Kabel
Frankfurt, Germany

"jst_se" schrieb im Newsbeitrag
...

I have an auto inserted datestamp when I open a workbook. The


dateformt

is yyyy-mm-dd (example: 2004-07-22), and I wonder if there are any


way

to convert it to yymmdd (example: 040722)?
Here's the VBA source I use to get the datestamp:

Private Sub Workbook_Open()
If Sheets("dayreport").Range("T5") = "" Then
Sheets("dayreport").Range("T5") = Date
Else
End If
End Sub

--
//Jst
Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/





--
Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird/
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
change date format from dd/mm/yyyy to mm/yyyy flow23 Excel Discussion (Misc queries) 3 April 4th 23 11:26 AM
Change format to mm dd yyyy hh mm ss Thomas New Users to Excel 1 March 4th 10 08:28 PM
how do I change date from mm/dd/yyyy to dd:mm:yyyy format in Excel Jack Wilson New Users to Excel 4 July 18th 06 01:57 PM
change birthday display from mm/dd/yyyy to HIDE the yyyy? johnp Excel Worksheet Functions 1 May 9th 06 09:56 PM
Datestamp Pieman Excel Worksheet Functions 4 March 11th 06 12:31 PM


All times are GMT +1. The time now is 05:55 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"