RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 801
- Office Version
- 365
- Platform
- Windows
I'm looking for a VBA way to convert these troublesome dates.
I have a range of dates from January to December, however there are two rogue dates placed in that reoccur a couple hundred times each.
These dates are 31/01/2019 and 28/02/2019 - these are mixed in with actual date-formatted cells as 31/02/2019 and 28/02/2019 - on the surface they look identical however they aren't counted the same way in Excel.
I wrote a macro that selected the whole column, converted the whole thing to date, but this didn't change anything. The cell format changed but the contents were very much still text. So I then added a feature onto the macro that was something like:
This worked, but it took a really very long time.
I'm having trouble with generic VBA codes that convert text to date because some dates actually are formatted as a date.
Any help? Thanks.
I have a range of dates from January to December, however there are two rogue dates placed in that reoccur a couple hundred times each.
These dates are 31/01/2019 and 28/02/2019 - these are mixed in with actual date-formatted cells as 31/02/2019 and 28/02/2019 - on the surface they look identical however they aren't counted the same way in Excel.
I wrote a macro that selected the whole column, converted the whole thing to date, but this didn't change anything. The cell format changed but the contents were very much still text. So I then added a feature onto the macro that was something like:
Code:
Cells(activecell.row, "G").value = cells(activecell.row, "G").value
This worked, but it took a really very long time.
I'm having trouble with generic VBA codes that convert text to date because some dates actually are formatted as a date.
Any help? Thanks.