Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub AddMenuIcon()
With Application.CommandBars("Standard").Controls.Add( _ Type:=msoControlButton, _ ID:=2950, Befo=9) .OnAction = "myMacro" End With End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Richard" wrote in message ... Hello, This is second time that I'm posting it. Hope someone can help me with this. I want to assign a macro( Userform1.show) to icon that I add in for command bar. I use the below code to add smiley icon on command bar and I want to use code to assign a macro. Sub AddMenuIcon() Application.CommandBars("Standard").Controls.Add Type:=msoControlButton, ID _ :=2950, Befo=9 ???????? <<== Here I want to code to assign macro so that if user click this amiley button, the userform can be poped up. End Sub Any help will be appreciated. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Existed where? already used on another button, or the image exists
somewhere? The former would be very difficult if not impossible unless you knew all controls that might use it, the latter is simple if you know the sheet and the image name. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Richard" wrote in message ... Bob, It works perfect; however, I have one more question. Before I create Smiley face icon, I want to chack if the Smiley face is already existed or not. If the Smiley face already existed, then I just want to assign the macro; otherwise, add Smiley face before assign the macro. Can you help me with this as well, please? Thank you so much. "Bob Phillips" wrote: Sub AddMenuIcon() With Application.CommandBars("Standard").Controls.Add( _ Type:=msoControlButton, _ ID:=2950, Befo=9) .OnAction = "myMacro" End With End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Richard" wrote in message ... Hello, This is second time that I'm posting it. Hope someone can help me with this. I want to assign a macro( Userform1.show) to icon that I add in for command bar. I use the below code to add smiley icon on command bar and I want to use code to assign a macro. Sub AddMenuIcon() Application.CommandBars("Standard").Controls.Add Type:=msoControlButton, ID _ :=2950, Befo=9 ???????? <<== Here I want to code to assign macro so that if user click this amiley button, the userform can be poped up. End Sub Any help will be appreciated. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Finding a single word match in a text string and assigning a code | Excel Worksheet Functions | |||
Urgent - Pl help code for assigning a shape to cells | Excel Programming | |||
Creating Buttons and assigning code | Excel Programming | |||
Assigning VBA code to a Toolbar | Excel Programming | |||
Assigning Selected Cells to Code | Excel Programming |