Solved

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

Posted on 2011-09-24
5
180 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

Technology Partners: 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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

696 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