Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default 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
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
How do I stop "global" hyperlinks changing to "local" links? Em Excel Worksheet Functions 2 August 26th 08 01:18 PM
Excel: Changing "numeric $" to "text $" in a different cell. Heather_CCF Excel Worksheet Functions 1 September 5th 06 06:06 PM
Changing "returned" values from "0" to "blank" LATATC Excel Worksheet Functions 2 October 20th 05 04:41 PM
Programatically Changing Hover Labels David Excel Programming 2 September 20th 05 12:48 PM
Changing format of column from "general" to "currency" Old Car Excel Programming 1 April 29th 05 09:49 AM


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