Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to attach function to a custom Menubar?


I have created a custom Menubar with 3 buttons in it. I got the code
from this NG posted by Bert. I would like to attach the UDF I have
written with these buttons. How to attach the UDF function to button?
I want
when clicked on button created, Formula wizard should come up
displaying UDF areguments. It is the popup you can see after click on
fx, selecting a function and click okey.

Menubar code written by Bert is as below(modified to my requirement)

Sub Add_Menubar()
Dim mb As CommandBar
Dim MenuName As String

Dim Cap(1 To 4)
Dim Act(1 To 4)

Cap(1) = "Growth"
Act(1) = Growth 'Growth is custom function or UDF
Cap(2) = "SP Incentive"
Act(2) = "SP_Incentive" 'SP_Incentiveis also UDF function.

MenuName = "&Salary"
MenuBars(xlWorksheet).Menus.Add Caption:=MenuName, befo="Help"

With MenuBars(xlWorksheet).Menus(MenuName).MenuItems
Add Caption:=Cap(1), OnAction:=Act(1)
Add Caption:=Cap(2), OnAction:=Act(2)
End With
End Sub


Regards,
Malcom


--
Malcom Jazz
------------------------------------------------------------------------
Malcom Jazz's Profile: http://www.excelforum.com/member.php...o&userid=15872
View this thread: http://www.excelforum.com/showthread...hreadid=273601

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
can i attach picture to cell and use vlookuo function? Oligo Excel Discussion (Misc queries) 2 November 4th 08 04:43 PM
Custom Menubar Bret Excel Discussion (Misc queries) 1 August 19th 07 11:52 PM
How can I attach a custom toolbar to only appear on one specific . ABuia Excel Worksheet Functions 1 January 18th 05 02:57 PM
Attach custom list to a cell Mark Excel Programming 7 April 5th 04 09:58 PM
attach custom toolbar to spreadsheet: how? Bart Plessers \(artabel\) Excel Programming 4 December 23rd 03 02:09 PM


All times are GMT +1. The time now is 05:12 PM.

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"