Hi, trying to figure out a code which will allow me to extract a date range from a cell. I was able to do it using Formulas(TextBefore and TextAfter) but would like to be able to insert this inside of a larger code.
Ideally, I'd like to go from this:
To this:
Note: Range D3 contains a different date format than the other cells in Column D. The date ranges will sometimes be written as 01/01/2020 or 1/1/2020 or 01/1/2020 or 1/01/2020 etc. Is there a way of making excel recognize the different date formats and extracting them?
Ideally, I'd like to go from this:
Book2 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Account Type | Notes | Total | Date Range | ||
2 | Bills | 1357888 (1/01/2020-2/01/2020) | 1000 | |||
3 | Bills | Monthly (1/01/2020-2/01/2020) | 500 | |||
4 | Bills | Expenses (02/01/2021-3/01/2021) | 1000 | |||
5 | Bills | 6000 (1/01/2020-2/01/2020) | 500 | |||
Sheet1 |
To this:
Book2 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Account Type | Notes | Total | Date Range | ||
2 | Bills | 1357888 (1/01/2020-2/01/2020) | 1000 | 1/01/2020-2/01/2020 | ||
3 | Bills | Monthly (1/01/2020-2/01/2020) | 500 | 1/01/2020-2/01/2020 | ||
4 | Bills | Expenses (02/01/2021-3/01/2021) | 1000 | 02/01/2021-3/01/2021 | ||
5 | Bills | 6000 (1/01/2020-2/01/2020) | 500 | 1/01/2020-2/01/2020 | ||
Sheet1 |
Note: Range D3 contains a different date format than the other cells in Column D. The date ranges will sometimes be written as 01/01/2020 or 1/1/2020 or 01/1/2020 or 1/01/2020 etc. Is there a way of making excel recognize the different date formats and extracting them?