Rob van Gelder has done it again. Formatting individual words in a cell is a real pain. Rob has developed some code that allows you enter markup-type language in a cell and covert it to formatted text. The text in cell A6 is his test data. I entered the string in cell A1 and “painted” it in cell A4.
Then I entered a different string in A1 and “painted” it in A1. It works. This is where the real benefit will come. I see an add-in with an Application-level SheetChange event that automatically formats the text you enter using markup tags. In such an add-in, he’ll need some unique identifier to start the string, like <html>. If the user enters
<html>I want to <s>delete</s> <i>remove</i> this section.
then the add-in will read the starting tag and know that it will format the remainder of the cell using Rob’s algorithm. Hopefully to produce
I want to
delete remove this section
Maybe <html> isn’t the best tag to use lest the user think they have all html tags available to them. Maybe <rvgml> for Rob van Gelder Markup Language would be more appropriate.
Rob’s method is pretty brute-force in that it reads each character one-by-one, but is genius nonetheless. If you step through the code, you can see just how he goes about formatting the string. By his own account, there isn’t much error checking in it yet, but it worked without error for everything that I tried. If you try it out and find an error, leave a comment here.
Cheers to you, Rob, for another job well done.