PC Review
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Setup
How to convert mm/dd/yyyy date format to yyyymmdd
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Setup
How to convert mm/dd/yyyy date format to yyyymmdd
![]() |
How to convert mm/dd/yyyy date format to yyyymmdd |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I have a cell with a custom date format of m/d/yyyy h:mm,
I need to convert the date to yyyymmdd text. Does anyone have a VB macro code snippet to do something like this? I've tried text to columns but can't get it to work...any help is appreciated. Thanks. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi Jeff,
I can help with part of this - don't know if it will give u the end solution you want, though... I can help u get from m/d/yyyy to yyyymmdd. You say you already have a cell with "m/d/yyyy h:mm". Select that cell; press Ctrl+1 to access the Format dialogue box for that cell. Select the tab number. in the category box, select "custom". Then, in the "type" box, type "yyyymmdd" - just that. that will automatically change your m/d/yyyy to yyyymmdd. You can also copy this format to any other cell in that workbook to get from m/d/yyyy to yyyymmdd. I don't understand what you mean when you write that you want to get from the "h:mm" part to "text". What text exactly? It is possible to have Excel just lose the h:mm in the cell so that you go from m/d/yyyy h:mm to plain old yyyymmdd - but what's this text u want to add? Hope this is of some help, Richard. "Jeff" <jwysocki@lodan.com> wrote in message news:0ef101c34593$5b14ba60$a001280a@phx.gbl... > I have a cell with a custom date format of m/d/yyyy h:mm, > I need to convert the date to yyyymmdd text. Does anyone > have a VB macro code snippet to do something like this? > I've tried text to columns but can't get it to work...any > help is appreciated. > > Thanks. |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Using VBA, the command you want is:
Range("C2")=Format(Range("B2"),"yyyymmdd"). Kim "Richard Adrian" <xxx@xxxx.com> wrote in message news:elDQr$ZRDHA.3880@tk2msftngp13.phx.gbl... > Hi Jeff, > > I can help with part of this - don't know if it will give u the end solution > you want, though... > > I can help u get from m/d/yyyy to yyyymmdd. > > You say you already have a cell with "m/d/yyyy h:mm". Select that cell; > press Ctrl+1 to access the Format dialogue box for that cell. Select the > tab number. in the category box, select "custom". Then, in the "type" box, > type "yyyymmdd" - just that. that will automatically change your m/d/yyyy > to yyyymmdd. You can also copy this format to any other cell in that > workbook to get from m/d/yyyy to yyyymmdd. > > I don't understand what you mean when you write that you want to get from > the "h:mm" part to "text". What text exactly? It is possible to have Excel > just lose the h:mm in the cell so that you go from m/d/yyyy h:mm to plain > old yyyymmdd - but what's this text u want to add? > > Hope this is of some help, > > Richard. > > "Jeff" <jwysocki@lodan.com> wrote in message > news:0ef101c34593$5b14ba60$a001280a@phx.gbl... > > I have a cell with a custom date format of m/d/yyyy h:mm, > > I need to convert the date to yyyymmdd text. Does anyone > > have a VB macro code snippet to do something like this? > > I've tried text to columns but can't get it to work...any > > help is appreciated. > > > > Thanks. > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Can you not just format the cell using Custom format
(Format>Cells>Custom Format) and type yyyymmdd ? >-----Original Message----- >I have a cell with a custom date format of m/d/yyyy h:mm, >I need to convert the date to yyyymmdd text. Does anyone >have a VB macro code snippet to do something like this? >I've tried text to columns but can't get it to work...any >help is appreciated. > >Thanks. >. > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

