+ Reply to Thread
Results 1 to 3 of 3

Icon Macro

  1. #1
    al007
    Guest

    Icon Macro

    Can I have a macro which would list my icon's control id & description
    & tell me which macro from my personal.xls is assigned to it.
    Thxs


  2. #2
    Bernie Deitrick
    Guest

    Re: Icon Macro

    Below is a macro that will find and list all custom buttons.

    HTH,
    Bernie
    MS Excel MVP

    Sub FindAllUserDefinedButtons()
    Dim CmdBar As CommandBar
    On Error GoTo ErrorReading:

    For Each CmdBar In CommandBars
    For i = 1 To CmdBar.Controls.Count
    If CmdBar.Controls(i).BuiltIn = False Then
    ActiveCell.Value = i
    ActiveCell.Offset(0, 1).Value = CmdBar.Controls(i).Caption
    ActiveCell.Offset(0, 2).Value = CmdBar.Name
    ActiveCell.Offset(0, 3).Value = CmdBar.Controls(i).ID
    ActiveCell.Offset(0, 4).Value = CmdBar.Controls(i).OnAction
    ActiveCell.Offset(1, 0).Select
    On Error GoTo ErrorReading:
    If CmdBar.Controls(i).Type = msoControlPopup Then
    For j = 1 To CmdBar.Controls(i).Controls.Count
    ActiveCell.Value = "'" & i & " / " & j
    ActiveCell.Offset(0, 1).Value = CmdBar.Controls(i).Controls(j).Caption
    ActiveCell.Offset(0, 2).Value = CmdBar.Name
    ActiveCell.Offset(0, 3).Value = CmdBar.Controls(i).ID
    ActiveCell.Offset(0, 4).Value = CmdBar.Controls(i).Controls(j).OnAction
    ActiveCell.Offset(1, 0).Select
    Next j
    End If

    End If
    ErrorReading:
    Next i
    Next CmdBar
    End Sub

    "al007" <[email protected]> wrote in message
    news:[email protected]...
    > Can I have a macro which would list my icon's control id & description
    > & tell me which macro from my personal.xls is assigned to it.
    > Thxs
    >




  3. #3
    al007
    Guest

    Re: Icon Macro

    Excellent !! - Exactly what I wanted - many thxs
    Bernie Deitrick wrote:
    > Below is a macro that will find and list all custom buttons.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    > Sub FindAllUserDefinedButtons()
    > Dim CmdBar As CommandBar
    > On Error GoTo ErrorReading:
    >
    > For Each CmdBar In CommandBars
    > For i = 1 To CmdBar.Controls.Count
    > If CmdBar.Controls(i).BuiltIn = False Then
    > ActiveCell.Value = i
    > ActiveCell.Offset(0, 1).Value = CmdBar.Controls(i).Caption
    > ActiveCell.Offset(0, 2).Value = CmdBar.Name
    > ActiveCell.Offset(0, 3).Value = CmdBar.Controls(i).ID
    > ActiveCell.Offset(0, 4).Value = CmdBar.Controls(i).OnAction
    > ActiveCell.Offset(1, 0).Select
    > On Error GoTo ErrorReading:
    > If CmdBar.Controls(i).Type = msoControlPopup Then
    > For j = 1 To CmdBar.Controls(i).Controls.Count
    > ActiveCell.Value = "'" & i & " / " & j
    > ActiveCell.Offset(0, 1).Value = CmdBar.Controls(i).Controls(j).Caption
    > ActiveCell.Offset(0, 2).Value = CmdBar.Name
    > ActiveCell.Offset(0, 3).Value = CmdBar.Controls(i).ID
    > ActiveCell.Offset(0, 4).Value = CmdBar.Controls(i).Controls(j).OnAction
    > ActiveCell.Offset(1, 0).Select
    > Next j
    > End If
    >
    > End If
    > ErrorReading:
    > Next i
    > Next CmdBar
    > End Sub
    >
    > "al007" <[email protected]> wrote in message
    > news:[email protected]...
    > > Can I have a macro which would list my icon's control id & description
    > > & tell me which macro from my personal.xls is assigned to it.
    > > Thxs
    > >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1