Solved

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

Posted on 2011-09-24
5
179 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

733 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