×

Add Line Breaks In Screentips & SuperTips (Ribbon XML)

By Chris Newman •  Updated: 10/27/22 •  3 min read
How to create multiline text in ribbon tooltips with Excel.

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.

  1. Screentip – The button tool tip’s header
  2. 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.

Screentip and Supertip example in Excel.

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.

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon startFromScratch="false">
    <tabs>
      <tab id="customTab" label="Custom Tab">
        <group id="customGroup" label="Custom Group">
          <button id="myButton01"
            label="Insert Legend"
            imageMso="OutlineGroup"
            screentip="Insert Legend"
            supertip="This does two things: &#13; 1. Counts selected cells &#13; &#13; 2. Inserts Legend graphic"/>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Here is what the supertip text looks like in Excel’s Ribbon:

A super tip text example 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.

Keep Learning

Chris Newman

Chris Newman

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.

[FREE Training] 10 Amazing Excel Efficiency Tricks. Why Don't People Know These?!

X