In a VB macro for Excel, how do I remove all occurances of a word that starts with a certain string?
Eg:
The string reads: xxxx $AUD543.43 yyyy
I want to search for anything in a string that starts with $AUD and remove the whole word before the next space
So the example above should result in:
xxxx yyyy
It would be remiss of me not to remind you of the expectation that you show “what you (have) tried”. (Which I do to avoid me being yelled at for answering the question.) My duty thus having been done, I now move on to it.
You actually don’t necessarily need VBA code to do this; you could do it with the Find() function albeit more clumsily and I wouldn’t recommend it for a really large sheet. Still, VBA code you have specified, and that you shall have. Change the range to match the one that you’ll be searching. ALSO, you should note that you have only one space between the x’s and y’s in your example but that varies from your request that it be the word starting with $AUD and ending BEFORE the next space. If you want only one space, please adjust the formulas accordingly.