LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 2
Default Macro - onAction arguments

Hello.
I have this code:

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Application.CommandBars("Cell").Reset
For Each Worksheet In Application.Worksheets
With Application.CommandBars("Cell").Controls
With .Add
.Caption = Worksheet.Name
.OnAction = "someMacro"
.Tag = "someTag"
.BeginGroup = True
End With
End With
Next
End Sub

It adds all sheets in the context menu.
There is just one more thing to be done.
When you click on a sheet from the context menu, it must became active.
Something like .OnAction = Worksheet.Select or a separate macro ....
I am not sure how to do it so i need some advice.
 
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
Passing several parameters to OnAction property. LABKHAND Excel Discussion (Misc queries) 1 April 24th 09 08:02 PM
OnAction of Menu Bar with variable parameters chris Excel Discussion (Misc queries) 1 August 7th 06 04:03 PM
Timing problem with OnAction! Fred Russell Charts and Charting in Excel 3 October 18th 05 06:11 PM
passing arguments from an excel macro to a word macro KWE39 Excel Discussion (Misc queries) 1 July 7th 05 03:56 PM
.ONACTION macro call fails Wayne Excel Discussion (Misc queries) 2 March 2nd 05 05:10 PM


All times are GMT +1. The time now is 06:45 AM.

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"