Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2010 - Can't assign macro to part of a Column Chart (Data Point)

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
GB
Good afternoon, I was hoping that I could assign a macro to a Data Point in a Column Chart so that the user could then see additional narrative that goes with the figures - just something simple like selecting another worksheet actually; unfortunately I only get the Series context shortcuts when I right click. Am I asking too much?

Many thanks,
D€$
 
Hi Skip, this is a chart within a sheet.

Many thanks,
D€$
 
If it were a ChartShert, the events would already exist. So in your case, you'll need to create Chart events via a new class.

I'm on my iPad in a doctor's office, so I can't recall all the hoops to jump thru. This link appears to have the steps. On the other hand, 2013 may have additional features that I haven't yet tapped. It does seem that the GetChartElement() function, that I used in 2003 version, may be obsolete.

Anyhow, here's the link:
Hope it helps.
 
OK, I'll have a look. Thanx. Hope it's just routine for you at the doctors?

Many thanks,
D€$
 
At the age of 72, I'm very close to being on borrowed time. However this time my wife is having a routine visit.
 
Spring chicken, m'friend. Hope your wife is fine too! Well, I had a look at the GetChartElement yesterday but still not sure if this is going to help me - basically as I'm having trouble understanding its concept!! OK, think I've got a handle on finding the co-ordinates of the item I require but not really what to do with it after that. I'll post this in the VBA Forum and see how it pans out.

Cheers Skip.

Many thanks,
D€$
 
GetChartElement is used in a Chart Event, like the MouseDown event. Yes, it detects the coordinates of the mouse, but according to the Chart Element of interest, like the Series Element for instance, it returns the Series number in Arg1 and the Point value in Arg2, which are the values that you probably need to know.

So to review, first you must expose the Chart Events for your embedded chart, and then you'll be able to use the GetChartElement to detect stuff clicked on in the chart.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top