-
2
- #1
HorseGoose
Programmer
I was getting tired of not finding the proper ids and names for the commandbar objects when I was referencing them in my code so I wrote this. It works OK not pretty but it maybe of use for someone. It outputs all commandbar controls menu name, control name and id to a blank sheet.
Probably of no use to anyone.
sub menuindex()
Row = 1
Range("a" & Row) = "Bar Name"
Range("b" & Row) = "Control ID"
Range("c" & Row) = "Control Caption"
For Each Bar In CommandBars
For Each ctl In Bar.Controls
Row = Row + 1
Range("a" & Row) = CStr(Bar.Name)
Range("b" & Row) = CStr(ctl.ID)
Range("c" & Row) = CStr(ctl.Caption)
Next ctl
Next Bar
End Sub
Probably of no use to anyone.
sub menuindex()
Row = 1
Range("a" & Row) = "Bar Name"
Range("b" & Row) = "Control ID"
Range("c" & Row) = "Control Caption"
For Each Bar In CommandBars
For Each ctl In Bar.Controls
Row = Row + 1
Range("a" & Row) = CStr(Bar.Name)
Range("b" & Row) = CStr(ctl.ID)
Range("c" & Row) = CStr(ctl.Caption)
Next ctl
Next Bar
End Sub