LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Assigning Macro by using code

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



 
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
Finding a single word match in a text string and assigning a code Morton Detwyler[_2_] Excel Worksheet Functions 6 September 15th 09 09:18 PM
Urgent - Pl help code for assigning a shape to cells Sarah Excel Programming 2 September 27th 04 09:53 PM
Creating Buttons and assigning code winshent Excel Programming 3 July 14th 04 09:14 AM
Assigning VBA code to a Toolbar Bonnie[_5_] Excel Programming 2 November 11th 03 06:23 PM
Assigning Selected Cells to Code JMay Excel Programming 4 July 19th 03 05:29 PM


All times are GMT +1. The time now is 09:45 PM.

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

About Us

"It's about Microsoft Excel"