Home |
Search |
Today's Posts |
#3
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
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. | Excel Worksheet Functions | |||
cell color index comparison | New Users to Excel | |||
Perform oiperations relative to initial selected cell | Excel Discussion (Misc queries) | |||
Min formula not returning value from Index | Excel Worksheet Functions | |||
index to a range of cells | Excel Worksheet Functions |