Forum Discussion
bakerbaker19
Dec 10, 2019Copper Contributor
VBA Code Help - Changing Color of Certain text and characters after specified text
So I am partially VBA savvy but this code seems way over my skill level. I am trying to find the text "ETIC-" in any cell and change it blue; the catch is, that I also want any character that follow...
- Dec 12, 2019
Hi bakerbaker19
Have attached a revised macro (Test2) which I think should work for every case.
Rich
Rich99
Dec 11, 2019Iron Contributor
- bakerbaker19Dec 11, 2019Copper Contributor
Rich99 After investigating what was going wrong, I finally figured it out and your code works!....most of the time. I don't know why but sometimes it doesn't highlight the last 1 to 3 characters before the "/". Do you have any idea what would cause this? (Thanks for the code though as it works 95% of the time!)
- Rich99Dec 12, 2019Iron Contributor
Hi bakerbaker19
Have attached a revised macro (Test2) which I think should work for every case.
Rich
- Rich99Dec 12, 2019Iron ContributorNo idea I'm afraid but can you attach a sample of where it doesn't work
Rich
- bakerbaker19Dec 11, 2019Copper Contributor
Unfortunately it does not. I am getting an error of "Run-time error '9': Subscript out of range" and it highlights this row "Out.Characters(x, Len(LArray(1))).Font.ColorIndex = 5 Rich99