Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Beyond "Changing Hover Labels"
I have a similar question (answered in a 9/17 post) with regard to accessing
tool tips. I'm plotting time series data that occasionally has anomalous entries, and I want to give the user a chance to look at the chronological context. I'd like to capture the date of the anomalous entry by right-clicking on the point and capturing the date of that entry, which is included in the tool tip when the cursor sits on the point. This brings up 2 questions: 1. How do I capture the date? 2. How do I add a menu item to the contextual menu? TIA, Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Beyond "Changing Hover Labels"
Hello Mike, I can partially answer your second question. I am going to assume you are talking about chart data. It would be helpful to know more about the chart and where on the chart you want to extract information. I bring this up because a chart has several context menus. I am providing you with an example of how to add an item to the context menu for a Cell on a Worksheet. This example will allow you to call your own macro. Code: -------------------- Sub AddToContextMenu() Dim cmdNew As CommandBarButton Set cmdNew = CommandBars("cell").Controls.Add With cmdNew .Caption = "My Procedure" 'This is what shows on the menu .OnAction = "MyProcedure" 'Name of the macro to execute .BeginGroup = True End With End Sub _________________________________________________ Sub RemoveContextMenuItem() On Error Resume Next CommandBars("cell").Controls("My Procedure").Delete End Sub -------------------- -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=478512 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Beyond "Changing Hover Labels"
Thanks, Leith, this is very helpful. But I still need to get the first
question answered, to get the date to put in the menu. Mike "Leith Ross" wrote: Hello Mike, I can partially answer your second question. I am going to assume you are talking about chart data. It would be helpful to know more about the chart and where on the chart you want to extract information. I bring this up because a chart has several context menus. I am providing you with an example of how to add an item to the context menu for a Cell on a Worksheet. This example will allow you to call your own macro. Code: -------------------- Sub AddToContextMenu() Dim cmdNew As CommandBarButton Set cmdNew = CommandBars("cell").Controls.Add With cmdNew .Caption = "My Procedure" 'This is what shows on the menu .OnAction = "MyProcedure" 'Name of the macro to execute .BeginGroup = True End With End Sub _________________________________________________ Sub RemoveContextMenuItem() On Error Resume Next CommandBars("cell").Controls("My Procedure").Delete End Sub -------------------- -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=478512 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I stop "global" hyperlinks changing to "local" links? | Excel Worksheet Functions | |||
Excel: Changing "numeric $" to "text $" in a different cell. | Excel Worksheet Functions | |||
Changing "returned" values from "0" to "blank" | Excel Worksheet Functions | |||
Programatically Changing Hover Labels | Excel Programming | |||
Changing format of column from "general" to "currency" | Excel Programming |