I have this code where i replace all dashes with an empty space.
Columns("C").Replace " - ", " ", xlPart, xlByRows, True
Now, I would like to replace dashes when the character before
are not numbers.
(Format NUMBER & DASH & NUMBER)
If I have in the cell:
I see 2 dashes in the same cell. But one of them as a number before and after the dash. So the macro would only replace the St-Mary to St Mary.
If for example i have in the cell:
10234 Saint-John auto parc-0234
In this cell, Saint-John dash would be removed as i see a letter before and after the dash, and parc-0234 dash also would be removed as i don't have a combination of a Number before and after the dash.
So it would return to: 10234 Saint John auto parc 0234
If i have in the cell:
Since before the dash, there is an empty space, it would remove the dash as only format Number & dash & number needs to stay the same. So the result would be: 1234 123456
I need to specify that the text in each cells of column C may have different characters length.
How can i do that.