RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 788
- Office Version
- 2010
- Platform
- Windows
Hello hello, possibly the last question for the year for me.
The cells in this filtered range can have anything in them:
Classical Andalucia - Heathrow
Andre Rieu - Live in Birmingham - Dublin
Etc etc
What I want to do, is have something loop down the list and replace everything after the rightmost hyphen with "By Air"
So it would look like:
Classical Andalucia - By Air
Andre Rieu - Live in Birmingham - By Air
Everything online appears to be about REMOVING the text, not REPLACING it, even when I google for "Replace" - which is weird.
Thanks.
VBA Code:
Set Rng = Range("D3:D" & Lastrowsd + LastrowCT - 2)
For Each cl In Rng.SpecialCells(xlCellTypeVisible)
' replace everything after " - " with "By Air"
Next cl
The cells in this filtered range can have anything in them:
Classical Andalucia - Heathrow
Andre Rieu - Live in Birmingham - Dublin
Etc etc
What I want to do, is have something loop down the list and replace everything after the rightmost hyphen with "By Air"
So it would look like:
Classical Andalucia - By Air
Andre Rieu - Live in Birmingham - By Air
Everything online appears to be about REMOVING the text, not REPLACING it, even when I google for "Replace" - which is weird.
Thanks.