ERLANDSEN DATA CONSULTING Excel & VBA Tips   Informasjon på norsk / Information in Norwegian

These pages are no longer updated and are only available for archive purposes.

Click here to visit the pages with updated information.

Edit the tooltip for toolbarbuttons (Office95 and earlier)

The examples below uses the New-button on the Standard toolbar as an example. You can replace the toolbarnumber with the number or name of another Toolbar, and the number of the button you want to edit.

Use this macro to change the tooltip text on custom or built-in toolbarbuttons:

Sub ChangeToolTip()
' changes the tooltip for a toolbarbutton
    Toolbars(1).ToolbarButtons(1).Name = "My custom tooltip"
End Sub

Use this macro to restore the tooltip text for a built-in toolbarbutton:

Sub ResetToolTip()
' removes a custom tooltip from a toolbarbutton
    Toolbars(1).ToolbarButtons(1).Name = Empty
End Sub

Use this macro to find the index number for the different toolbars:

Sub DisplayToolBarNumber()
' displays number and name to all toolbars
Dim i As Integer
    i = 0
    For i = 1 To Application.Toolbars.Count
        MsgBox Toolbars(i).Name, , "Toolbar " & _
            i & " of " & Application.Toolbars.Count
    Next i
End Sub

NOTE! The toolbar buttons on a toolbar is counted from left to right, extra spaces between the buttons counts as a button.


Document last updated 2000-02-05 12:47:00      Printerfriendly version


Erlandsen Data Consulting   
Excel & VBA Tips   Copyright ©1999-2024    Ole P. Erlandsen   All rights reserved
E-mail Contact Address