AllExperts > VB Script 
Search      
VB Script
Volunteer
Answers to thousands of questions
 Home · More VB Script Questions · Answer Library  · Encyclopedia ·
More VB Script Answers
Question Library

Ask a question about VB Script
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Subbu
Expertise
I can answer VB Script questions which are related to Visual Basic / VBA / QTP Scripts.

Experience
8 Years

Education/Credentials
Master of Computer Applications

Awards and Honors
Established Member from QA Forums and Brainbench certification

 
   

You are here:  Experts > Computing/Technology > Basic > VB Script > Extract DAte from a string

VB Script - Extract DAte from a string


Expert: Subbu - 5/15/2009

Question
HI I have a column which contains data in the format :
l3=12/3/2009
l3=23/4/2009
...
...

I need to extract the date part from it...
I do not want to trim the first 3 characters and get the date out of it,,because i need to process the date further..

Is there any function that can accomplish that..
Thanks  

Answer
Ashish,

There are two steps to get your dates.

Col A           Col B
13=11/12/2008   39764 use =DATEVALUE(MID(A1,4,LEN(A1)-3)) to get 39764
13=11/3/2008   39755
13=11/2/2008   39754

Then select all date value cells, select Format Menu, Cells Option, select date format you want.


Another method is you can use VBA code to display date in date format directly.  If you want VBA code I need some time to write it.

Thanks.  

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.