I am trying to turn a string containing unwanted text, a date, and an unwanted time in to an entry that contains only the date.
This is a sample of what I am starting with:
"Started: Sunday, October 30, 2016 3:17:37 PM"
And from that I would like to get:
"October 30, 2016"
I have tried to search the string for a comma using this code:
Dim fulldate As String, commaposition As Integer
fulldate = Cells(1, 1).Value
commaposition = InStr(fulldate, ",")
Cells(1, 2).Value = Right(fulldate, commaposition)
This however returns:
"2016 3:17:37 PM"
as it seems to pick the wrong comma. I was hoping for the other comma, and then I could work on getting the time out, but alas I am stuck.
Maybe there is some basic function I am missing? I understand looping and how to manipulate the code to work with multiple sets once I can figure the base out.