![]() |
Convert text date to general number
Hi,
I have a text value for the date. I want to convert it to a number (ie from 190707 to 39282). Please note the format of the date is ddmmyy -- Andrew |
Convert text date to general number
Make sure the cells are not formatted as text, then do datatext to columns,
click next twice, in step 3 select date under column data format and from date dropdown select DMY, click finish -- Regards, Peo Sjoblom "Andrew" wrote in message ... Hi, I have a text value for the date. I want to convert it to a number (ie from 190707 to 39282). Please note the format of the date is ddmmyy -- Andrew |
Convert text date to general number
Sorry, I should have explained I had the date in a variable name (The_Date)
in VBA code. Any ideas? -- Andrew "Peo Sjoblom" wrote: Make sure the cells are not formatted as text, then do datatext to columns, click next twice, in step 3 select date under column data format and from date dropdown select DMY, click finish -- Regards, Peo Sjoblom "Andrew" wrote in message ... Hi, I have a text value for the date. I want to convert it to a number (ie from 190707 to 39282). Please note the format of the date is ddmmyy -- Andrew |
Convert text date to general number
Try this...
The_Date = "190707" SerialNumber = CDbl(DateSerial("20" & Right$(The_Date, 2), _ Mid$(The_Date, 3, 2), Left$(The_Date, 2))) Rick "Andrew" wrote in message ... Sorry, I should have explained I had the date in a variable name (The_Date) in VBA code. Any ideas? -- Andrew "Peo Sjoblom" wrote: Make sure the cells are not formatted as text, then do datatext to columns, click next twice, in step 3 select date under column data format and from date dropdown select DMY, click finish -- Regards, Peo Sjoblom "Andrew" wrote in message ... Hi, I have a text value for the date. I want to convert it to a number (ie from 190707 to 39282). Please note the format of the date is ddmmyy -- Andrew |
Convert text date to general number
You legend!
Thanks You deserve your MVP -- Andrew "Rick Rothstein (MVP - VB)" wrote: Try this... The_Date = "190707" SerialNumber = CDbl(DateSerial("20" & Right$(The_Date, 2), _ Mid$(The_Date, 3, 2), Left$(The_Date, 2))) Rick "Andrew" wrote in message ... Sorry, I should have explained I had the date in a variable name (The_Date) in VBA code. Any ideas? -- Andrew "Peo Sjoblom" wrote: Make sure the cells are not formatted as text, then do datatext to columns, click next twice, in step 3 select date under column data format and from date dropdown select DMY, click finish -- Regards, Peo Sjoblom "Andrew" wrote in message ... Hi, I have a text value for the date. I want to convert it to a number (ie from 190707 to 39282). Please note the format of the date is ddmmyy -- Andrew |
Convert text date to general number
Hi,
For more information, please refer to the following site: http://www.contextures.com/xlDataEntry02.html Challa Prabhu "Andrew" wrote: Hi, I have a text value for the date. I want to convert it to a number (ie from 190707 to 39282). Please note the format of the date is ddmmyy -- Andrew |
Convert text date to general number
Just to keep things straight... my MVP is not for Excel related
activities... it is for programming in Visual Basic (the compiled version). I'm a relative new comer to the Excel world (well, actually, a returnee after a long absence), but I find a lot of the programming skills I acquired over in the compiled world of VB can be translated into Excel, so every now and then I can "get one right". With that said, I like to point out that these various Excel newsgroups have several Excel MVPs (and several non-MVPs as well) who are the true legends... I've seen displays of Excel related skills by these individuals which I find truly amazing and awe inspiring. They volunteer their time and skills to help others here... these are the people who deserve your praise, not me (trust me on that). Rick "Andrew" wrote in message ... You legend! Thanks You deserve your MVP -- Andrew "Rick Rothstein (MVP - VB)" wrote: Try this... The_Date = "190707" SerialNumber = CDbl(DateSerial("20" & Right$(The_Date, 2), _ Mid$(The_Date, 3, 2), Left$(The_Date, 2))) Rick "Andrew" wrote in message ... Sorry, I should have explained I had the date in a variable name (The_Date) in VBA code. Any ideas? -- Andrew "Peo Sjoblom" wrote: Make sure the cells are not formatted as text, then do datatext to columns, click next twice, in step 3 select date under column data format and from date dropdown select DMY, click finish -- Regards, Peo Sjoblom "Andrew" wrote in message ... Hi, I have a text value for the date. I want to convert it to a number (ie from 190707 to 39282). Please note the format of the date is ddmmyy -- Andrew |
All times are GMT +1. The time now is 04:01 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com