Excel Vba Convert Date To Serial Number

Convert a Text String Date to Date Serial Number In previous posts I’ve been going through some formulas designed to extract and convert a text string Date, to a. Nov 07, 2005  Convert date serial to date? Discussion in 'Microsoft Access External Data' started by Guest, Nov 7. The problem that I have been having is that when I convert a date into text, it changes it into a date serial (i.e. Changes 03/12/02 into. Export serial date to excel as a string. Serial Comms - Interface. Inport data from a serial.

Posted by4 months ago

Converting a serial number date to a date format

So I've been messing with a formula to export data from a table to make a formatted list and while I've got advice about that in this subreddit, my dates seem to be converting into the date serial numbers when the info from the date cell is exported into the list.

I don't know how to better explain it than with a picture, so here it is:

Changing the cell format doesn't do anything, whether I set it to text or date, or any other option. What I need is for the date to be copied the same way it is in the date column instead of converting to a serial number.

Excel Date Showing As Number

Convert

Also, after that, it would be great if I could automatically copy the data into another document, but to do that I would need it to be formatted slightly differently. So instead of:

name: Julian, date: 23-03-01, notes: N/A

I would prefer it to be:

name: Julian

date: 23-03-01

notes: N/A

with line breaks instead of commas as dividers.

I appreciate any help

100% Upvoted

I have an 8 digit number that tells me the date, YYYYMMDD. How can I convert this number into a date that Excel will recognize as a date.

Let's assume cell A1 has 20120229 in it...what do I do?

phanphan

3 Answers

Since you tagged this question VBA, I assume you want an answer in VBA, so here you go:

Jean-François CorbettJean-François Corbett

Use this formula: =DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)) where A1 is the cell coordinate.

Máté GeleiMáté Gelei

I like being able to select text in excel and call a macro to do the work.

Aaron BrayAaron Bray

Date Converter

Not the answer you're looking for? Browse other questions tagged excelvbadatetime or ask your own question.