LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Ed Ferrero
 
Posts: n/a
Default

Hi Jon,

There is also this old post from Eric Wells, if you do not like to use XLM.
<quote
'There is no easy way, as there is no name property for the Point
'object. Below you will find a function that will return a string
'corresponding to the point designation you see in the dropdown name box
'on a chart sheet (I've also included a macro that calls the function).
'The function relies on setting the MarkerStyle property of the point
'and then using a For-Next loop to identify the point index and then
'resetting the markerstyle. Note that there is no error checking to
'make sure that a point is actually selected, nor to check to see if the
'proper marketstyle is being used (if the entire series is formatted as
'xlstar, the funciton will fail - you'll have to select a different
'markerstyle).

Sub GetPoint()
Dim PointObject As Object
Set PointObject = Selection
MsgBox ReturnPoint(PointObject)
End Sub

Function ReturnPoint(PointObject As Object) As String
Dim PointMarkerStyle As Variant
Dim SeriesNum As Integer
Dim PointNum As Integer
Dim x As Integer
PointMarkerStyle = PointObject.MarkerStyle
PointObject.MarkerStyle = xlStar
With ActiveChart.SeriesCollection(PointObject.Parent.Na me)
SeriesNum = .PlotOrder
For x = 1 To .Points.Count
If .Points(x).MarkerStyle = xlStar Then
PointNum = x
Exit For
End If
Next
End With
PointObject.MarkerStyle = PointMarkerStyle
ReturnPoint = "S" & SeriesNum & "P" & PointNum
End Function

'-Eric Wells
'Microsoft
</quote

Ed Ferrero
http://edferrero.m6.net/



You need to use an old-style XLM command for this, as Stephen Bullen
pointed out in his post 14-Jan-2001:

Sub WhichPoint()

Dim sPoint As String
Dim iSeries As Integer, iPoint As Integer

sPoint = ExecuteExcel4Macro("SELECTION()")

If sPoint Like "S*P*" Then
iSeries = Val(Mid$(sPoint, 2))
iPoint = Val(Mid$(sPoint, Len(iSeries) + 2))

MsgBox "Series " & iSeries & ", Point " & iPoint
Else
MsgBox "Please select a single data point."
End If

End Sub


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Schlupp wrote:

Hi,

I need help. I must get the index of a the currently selectd point in
the chart. I can't use the Mouseup event.
It will be better to determinate the x and y value from the actual
selected point but the index will also be good.

Please help!

thx
Jens



 
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 make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. Daniel Excel Worksheet Functions 1 July 12th 05 01:30 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Perform oiperations relative to initial selected cell scratching my head Excel Discussion (Misc queries) 1 May 30th 05 05:42 PM
Min formula not returning value from Index ExcelMonkey Excel Worksheet Functions 3 January 29th 05 01:47 AM
index to a range of cells Frank Kabel Excel Worksheet Functions 0 October 27th 04 05:39 PM


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