Face ID in column with their Names in Excel sheet using vba

sanits591

Active Member
Joined
May 30, 2010
Messages
253
Hi,

I have an excel sheet with Face ID icons of the command bars.

Request to help me i arranging in the column Face ID icons in columns A, and their Names in Col B using some VBA codes.

Anticipatory thanks!
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
try

Code:
Sub test()
    With Application.CommandBars("Standard")
        For r = 1 To .Controls.Count
            Cells(r, 1) = .Controls(r).Caption
            Cells(r, 2) = .Controls(r).ID
        Next
    End With
End Sub

Not exactly what you mentioned, but it may help.
 
Last edited:
Upvote 0
I missed the part about two columns, but if you want the FaceID icons, maybe try CopyFace. Something similar to:

Rich (BB code):
Sub exa()
Dim CB          As CommandBar
Dim ctl         As CommandBarButton
Dim strCBName   As String
Dim wbTemp      As Workbook
Dim wks         As Worksheet
Dim rngInput    As Range
Dim i           As Long
    
    '// Add a temp commandbar, make it a popup (which we won't show); add a temp control //
    Set CB = CommandBars.Add(Position:=msoBarPopup, MenuBar:=False, Temporary:=True)
    
    Set ctl = CB.Controls.Add(Type:=msoControlButton, Temporary:=True)
    strCBName = CB.Name
    
    Set wbTemp = Workbooks.Add(xlWBATWorksheet)
    Set wks = wbTemp.Worksheets(1)
    Set rngInput = wks.Range("B:B")
    
    rngInput.Offset(, -1).ColumnWidth = 3
    rngInput.ColumnWidth = 18
    rngInput.HorizontalAlignment = xlRight
    
    '// Change range of FaceID's you want to return to suit.//
    For i = 1 To 50
        ctl.FaceId = i
        ctl.CopyFace
        rngInput.Cells(i).PasteSpecial
        rngInput.Cells(i).Value = i
    Next
    
    '// just so the last image pasted doesn't stay selected//
    rngInput.Cells(1).Select
    
    '// Kill the temp cbar and ctrl //
    On Error Resume Next
    Set CB = CommandBars(strCBName)
    On Error GoTo 0
    
    If Not CB Is Nothing Then
        CB.Delete
    Else
        MsgBox "ACK!  I lost a toolbar!", 0, vbNullString
    End If
End Sub

Hope that helps,

Mark
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,176
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top