Solved

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

Posted on 2011-09-24
5
175 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
Comment Utility

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

Author Comment

by:pr0fier
Comment Utility
in my example 030271 this wil return 16111982 ??
0
 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
Just use a custom number format of:

ddmmyy

and enter your date normally.
0
 
LVL 8

Accepted Solution

by:
wchh earned 250 total points
Comment Utility
0
 
LVL 85

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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;…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

772 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

11 Experts available now in Live!

Get 1:1 Help Now