Add Line Breaks In Screentips & SuperTips (Ribbon XML)
Parts Of A Ribbon Button’s Tool Tip
Programatically, there are two parts to a button’s tool tip box that appears when you hover over a button in Microsoft Excel.
- Screentip – The button tool tip’s header
- SuperTip – The text description explaining what the button does or providing tips on how to utilize the button’s capabilities
NOTE: You can NOT have multiple lines of text within the ScreenTip.
If you want to format the description text in your button’s tooltip there is a shortcode you need to use to add line breaks to your text.
Use the shortcode
This unique code will add a line break to your text within the SuperTip. You do not need to wrap any quotation marks around this shortcode, you simply type it into your text string.
For example, if you wanted the text “Cat, Dog, Bird” to be on 3 separate lines in your SuperTip text, you would write:
supertip="Cat Dog Bird"
Let’s say you want to double-space your list. You can repeat the shortcode to double up the line breaks. It would look something like this:
supertip="Cat Dog Bird"
Multi-Line SuperTip Ribbon XML Example
Below is some sample XML code where the button’s screentip has multiple line breaks inserted within the tip text.
<tab id="customTab" label="Custom Tab">
<group id="customGroup" label="Custom Group">
supertip="This does two things: 1. Counts selected cells 2. Inserts Legend graphic"/>
Here is what the supertip text looks like in Excel’s Ribbon:
I Hope This Microsoft Excel Article Helped!
Hopefully, I was able to explain how you can write XML code to insert line breaks into your supertip text. If you have any questions about this technique or suggestions on how to improve it, please let me know in the comments section below.
After 10+ years of creating macros and developing add-ins, I've compiled all the hacks I wish I had known years ago!
How To Add A Center Across Selection Button To Excel’s Home Ribbon Tab
Why Center Across? I am a huge advocate for using the Excel functionality of Center Across Selection instead of Merge...
How To Prevent The Excel Error Message For A Missing Add-in
I’ve run into this issue numerous times and I just figured out how to prevent the dreaded error message from...
Chris is a finance professional and Excel MVP recognized by Microsoft since 2016. With his expertise, he founded TheSpreadsheetGuru blog to help fellow Excel users, where he shares his vast creative solutions & expertise. In addition, he has developed over 7 widely-used Excel Add-ins that have been embraced by individuals and companies worldwide.