Solved

How to format a cell in Excel 2010 and back to a date value?

Posted on 2011-09-24
5
176 Views
Last Modified: 2012-05-12
I use a cell format 00"-"00"-"00 to input a "date" like 030271
(3 febr. 1971) But the cell does not contain a date using this method. What code can I use with VBA to convert this cell to the proper date value? It's not a problem if the result will be put in a different cell.

Thnx Remco
0
Comment
Question by:pr0fier
5 Comments
 
LVL 11

Expert Comment

by:Swapnil Nirmal
ID: 36593178

mydate = format("myvalue", "DDMMYYYY")
0
 

Author Comment

by:pr0fier
ID: 36593317
in my example 030271 this wil return 16111982 ??
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 36593328
Just use a custom number format of:

ddmmyy

and enter your date normally.
0
 
LVL 8

Accepted Solution

by:
wchh earned 250 total points
ID: 36597063
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 36597549
If you can use an adjacent cell, you can just use a formula:
=TEXT(A1,"00-00-00")+0
for example.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now