• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

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

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
1 Solution
Swapnil NirmalManager, Audit AnalyticsCommented:

mydate = format("myvalue", "DDMMYYYY")
pr0fierAuthor Commented:
in my example 030271 this wil return 16111982 ??
Patrick MatthewsCommented:
Just use a custom number format of:


and enter your date normally.
Rory ArchibaldCommented:
If you can use an adjacent cell, you can just use a formula:
for example.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now