任何人都可以在Excel 2010中显示button面号列表

我想使用VBA在我的Excel 2010文件中使用预定义的使用脸部ID的Excelbutton来创build成本菜单button。 在我的情况下,我想使用“locking”和“刷新”图标,但不知道该图标的人脸ID。 任何人都可以显示或指向我在Excel 2010中使用的button和脸部ID列表?

看看这里:

面孔ID

它是MS excel的一个插件。 适用于Excel 97及更高版本。

下面的Sub BarOpen()与Excel 2010一起工作,最有可能的还有很多其他的版本,并且在Tab“Add-Ins”中生成一个自定义的临时工具栏,下拉菜单以1 … 5020的forms显示FaceID 30个项目。

Option Explicit Const APP_NAME = "FaceIDs (Browser)" ' The number of icons to be displayed in a set. Const ICON_SET = 30 Sub BarOpen() Dim xBar As CommandBar Dim xBarPop As CommandBarPopup Dim bCreatedNew As Boolean Dim n As Integer, m As Integer Dim k As Integer On Error Resume Next ' Try to get a reference to the 'FaceID Browser' toolbar if it exists and delete it: Set xBar = CommandBars(APP_NAME) On Error GoTo 0 If Not xBar Is Nothing Then xBar.Delete Set xBar = Nothing End If Set xBar = CommandBars.Add(Name:=APP_NAME, Temporary:=True) ', Position:=msoBarLeft With xBar .Visible = True '.Width = 80 For k = 0 To 4 ' 5 dropdowns, each for about 1000 FaceIDs Set xBarPop = .Controls.Add(Type:=msoControlPopup) ', Before:=1 With xBarPop .BeginGroup = True If k = 0 Then .Caption = "Face IDs " & 1 + 1000 * k & " ... " Else .Caption = 1 + 1000 * k & " ... " End If n = 1 Do With .Controls.Add(Type:=msoControlPopup) '34 items * 30 items = 1020 faceIDs .Caption = 1000 * k + n & " ... " & 1000 * k + n + ICON_SET - 1 For m = 0 To ICON_SET - 1 With .Controls.Add(Type:=msoControlButton) ' .Caption = "ID=" & 1000 * k + n + m .FaceId = 1000 * k + n + m End With Next m End With n = n + ICON_SET Loop While n < 1000 ' or 1020, some overlapp End With Next k End With 'xBar End Sub 

我在这个位置发现了我正在看的东西

http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;Q213552

该表格包含Excel中使用的Control和id(Face Id)。 所以对于“刷新”button,脸部ID是459,但是它只能用于小于3位的ID。

和这个生成器(通过input开始人脸ID和端面ID),然后点击显示button的面孔,你得到的范围图标列表(要下载它必须先login)

http://www.ozgrid.com/forum/showthread.php?t=39992

这是function区工具栏

http://www.rondebruin.nl/ribbon.htm

短脚本写十(循环设置为10)FaceID的添加。 作为进入工具栏选项卡“加载项”和“Benutzerdefinierte Symbollistelöschen” – 删除此添加项(标记和鼠标右键单击) – 与Excel 2010/2013

 Sub FaceIdsAusgeben() Dim symb As CommandBar Dim Icon As CommandBarControl Dim i As Integer On Error Resume Next Set symb = Application.CommandBars.Add _ ("Symbole", msoBarFloating) For i = 1 To 10 Set Icon = symb.Controls.Add(msoControlButton) Icon.FaceId = i Icon.TooltipText = i Debug.Print ("Symbole = " & i) Next i symb.Visible = True End Sub 

脚本提供Excel 2010/2013控件的工作表名称

 Sub IDsErmitteln() Dim crtl As CommandBarControl Dim i As Integer Worksheets.Add On Error Resume Next i = 1 For Each crtl In Application.CommandBars(1).Controls(1).Controls Cells(i, 1).Value = crtl.Caption Cells(i, 2).Value = crtl.ID i = i + 1 Next crtl End Sub 

修改了以前的答案 ,创build了许多带有10个图标的工具栏。 可以更改工具栏的代码(注释/取消注释)数量(在较慢的机器上,性能可能较慢)

OneDrive的最后一个Office 2013图标编号是25424

 Sub FaceIdsOutput() ' ================================================== ' FaceIdsOutput Macro ' ================================================== ' ========================= Dim sym_bar As CommandBar Dim cmd_bar As CommandBar ' ========================= Dim i_bar As Integer Dim n_bar_ammt As Integer Dim i_bar_start As Integer Dim i_bar_final As Integer ' ========================= Dim icon_ctrl As CommandBarControl ' ========================= Dim i_icon As Integer Dim n_icon_step As Integer Dim i_icon_start As Integer Dim i_icon_final As Integer ' ========================= n_icon_step = 10 ' ========================= i_bar_start = 1 n_bar_ammt = 500 ' i_bar_start = 501 ' n_bar_ammt = 1000 ' i_bar_start = 1001 ' n_bar_ammt = 1500 ' i_bar_start = 1501 ' n_bar_ammt = 2000 ' i_bar_start = 2001 ' n_bar_ammt = 2543 i_bar_final = i_bar_start + n_bar_ammt - 1 ' ========================= ' delete toolbars ' ========================= For Each cmd_bar In Application.CommandBars If InStr(cmd_bar.Name,"Symbol") <> 0 Then cmd_bar.Delete End If Next ' ========================= ' create toolbars ' ========================= For i_bar = i_bar_start To i_bar_final On Error Resume Next Set sym_bar = Application.CommandBars.Add _ ("Symbol" & i_bar, msoBarFloating, Temporary:=True) ' ========================= ' create buttons ' ========================= i_icon_start = (i_bar-1) * n_icon_step + 1 i_icon_final = i_icon_start + n_icon_step - 1 For i_icon = i_icon_start To i_icon_final Set icon_ctrl = sym_bar.Controls.Add(msoControlButton) icon_ctrl.FaceId = i_icon icon_ctrl.TooltipText = i_icon Debug.Print ("Symbol = " & i_icon) Next i_icon sym_bar.Visible = True Next i_bar End Sub 
 Sub DeleteFaceIdsToolbar() ' ================================================== ' DeleteFaceIdsToolbar Macro ' ================================================== Dim cmd_bar As CommandBar For Each cmd_bar In Application.CommandBars If InStr(cmd_bar.Name,"Symbol") <> 0 Then cmd_bar.Delete End If Next End Sub