I am trying to replace all special characters in an Excel sheet.
But ? (question mark) and * (asterisk) are resulting in a blank cell
The code I'm using:
Selection.Replace What:="!", Replacement:=" "
Selection.Replace What:="@", Replacement:=" "
Selection.Replace What:="#", Replacement:=" "
.... so on
Question marks and asterisks are known as wildcards in find and replace functions, this means they already mean something other than their string values. In order to get round this you need to precede them with a tilde (~).
Try:
Selection.Replace What:="~?", Replacement:=" "
Selection.Replace What:="~*", Replacement:=" "
Here's a helpful link: https://support.microsoft.com/en-gb/kb/214138
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With