FaceID (icons) for Excel ToolBar

Joined
Oct 11, 2006
Messages
3
Reaction score
0
Hi, I was looking over the internet for some kind of index for the icons in the Excel Toolbar. Unfortunately couldnt find, so I created a funcion to create an index with almos every icon avalilable in excel.

You can use this icons to customize your own persolan buttons and toolbar. By the way, you can use the function to automate the criation of buttons and toolbars.

Here is the code:

Sub CreateButton()
Application.ScreenUpdating = False
Dim caption As String
Dim tip As String
Dim i As Integer
For i = 1 To 5000
caption = i
tip = i
Call CreateBarButton(caption, "", tip, i)
Next
Application.ScreenUpdating = True
End Sub

Sub CreateBarButton(Optional strCaption As String, Optional strFuncao As String, Optional strTip As String, Optional myFaceID As Integer)
On Error Resume Next
Dim Barra As Office.CommandBar
Dim Botao As CommandBarControl
Dim FlagBarra As Boolean
Dim FlagBotao As Boolean
FlagBarra = False
For Each Barra In Application.CommandBars
If Barra.Name = "myBar" Then
FlagBarra = True
Barra.Visible = True
End If
Next Barra
If FlagBarra = False Then
Set Barra = Application.CommandBars.Add(Name:="myBar", Position:=msoBarTop)
Barra.Visible = True
End If
For Each ctl In Application.CommandBars("myBar").Controls
If ctl.caption = strCaption Then
ctl.Delete
End If
Next ctl
Set Botao = Application.CommandBars("myBar").Controls.Add(Type:=msoControlButton, ID:=myFaceID, Before:=1)
Botao.Visible = True
Botao.Style = msoButtonIconAndCaption
Botao.caption = strCaption
Botao.OnAction = strFuncao
Botao.TooltipText = strTip
Application.CommandBars("myBar").Width = 1200
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top