convert text to date

Status
Not open for further replies.

sneaky30

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Office 365 Exchange
I am exporting appointments from excel to outlook custom calendar.
But i get a script error on the date cell.
When i put a date format in the cell it will export it to outlook. But the file i want to use have a date in the form of a text cell.

this is the content of the cell:

Thursday, 29 October, 2015

predefined as text. And i like to convert this to a real date.

can somebody help?

preferred in vba so i can add this to my macro.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Try using split - this assumes all dates in the column are using the same format. It might work to just split it and use the strdate(1) reference (outlook should work with the standard date format) - cdate converts it to 29/10/2015 format.

strDate = Split(cell reference, (", "))
MsgBox CDate(strDate(1))

The other option is to change the formar on the cells, if its a date field rather than a text field.
 
Status
Not open for further replies.
Top