#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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" wrote in message
oups.com...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default 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" wrote in message
oups.com...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Icon Sets - Display icon in one cell depending upon value in anoth Nolene Excel Worksheet Functions 2 February 26th 10 05:43 AM
macro - stop recording icon fran4444 Excel Discussion (Misc queries) 3 September 7th 07 01:24 AM
macro icon JIM.H.[_2_] Excel Programming 2 September 19th 04 09:00 PM
Can Excel Macro DoubleClick Icon? Al Excel Programming 3 June 10th 04 02:52 PM
Executing a Macro From a Desktop Icon SidBord Excel Programming 1 April 25th 04 07:19 AM


All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"