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: 102
Default Need Help with a Menu Item .OnAction property

I have added a new menu to Excel called "Budget"

Within the worksheet that this menu will act on are 5 named ranges
whose names are stored in the string RngName, e.g. the first named
range is in RngName(1), the 2nd in RngName(2), etc.

There is a corresponding menu item in the menu to each of these ranges
and depending on which is selected, the same set of actions will occur
to that range.

When I'm setting up the menu can I do the following (I don't have
WIndows vs of Excel to check this at home)

Set HelpMenu = CommandBars(1).FindControl(Id:=30010)
If HelpMenu = Nothing Then
Set NewMenu = Commandbars(1).Controls.AddType:=msoControlPopup,
Temporary:=True)
Else
Set NewMenu = Commandbars(1).Controlls.AddType:=msoControlPopup, _
Befo=HelpMenu, Temporary:=True)
End If
NewMenu.Caption = "&Budget"
For i = 1 to 5
Set MenuItem = NewMenu.Controls.Add(Type:=msoControlButton)
With MenuItem
..Caption = MIStr(i)
..OnAction = Macro1(RngName(i))
If Action(i) = False Then
..Enabled = False
Else
..Enabled = True
End If
End With

I guess my question is, will the .OnAction properly pass the the
RngName(i) string that holds
the range name?

 
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
OnAction menu item property coding BrianB Excel Programming 1 July 13th 04 09:43 PM
Button Selection OnAction property Grant Reid Excel Programming 7 June 26th 04 03:39 AM
Setting OnAction of custom menu item? Ed[_18_] Excel Programming 12 May 10th 04 02:55 PM
Find OnAction property Kemosabe Excel Programming 1 November 21st 03 03:34 PM


All times are GMT +1. The time now is 05:24 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"