dkmoreland
Registered User.
- Local time
- Today, 10:17
- Joined
- Dec 6, 2017
- Messages
- 129
I have a text string in an Excel spreadsheet that I am trying to split into a start date and an end date and store them in the start_date and end_date fields in an Access table.
The string looks like this and is always in the A7 cell of this spreadsheet:
From: 3/2/2018 To: 3/8/2018
I am using this code to extract the characters that comprise the date:
The problem will come in when the month and/or the day are two digits - I've already run into a data type mismatch issue trying to leave room for additional date characters.
Can anyone suggest a better way to do this?
Thanks in advance.
The string looks like this and is always in the A7 cell of this spreadsheet:
From: 3/2/2018 To: 3/8/2018
I am using this code to extract the characters that comprise the date:
Code:
dStart_date = Mid(Range("'Sheet1'!A7").Value, 7, 10)
dEnd_date = Mid(Range("'Sheet1'!A7").Value, 21, 11)
The problem will come in when the month and/or the day are two digits - I've already run into a data type mismatch issue trying to leave room for additional date characters.
Can anyone suggest a better way to do this?
Thanks in advance.