Chart SelectByVal ElementID As Long ByVal Arg As Long ByVal Arg As Long

Chart_Select occurs when a chart element is selected. ElementID is the part of the chart selected, such as the Legend; Argl and Arg2 are dependent upon the ElementID.

The following program highlights the data set when a point on the chart is selected:

Private Sub Chart_Select(ByVal ElementID As Long, ByVal Argl As Long, _

ByVal Arg2 As Long) If Argl = 0 Then Exit Sub Sheets("sheet1").Select Cells.Interior.ColorIndex = xlNone

With Range(Cells(Arg1 + 1, 1), Cells(Arg1 + 1, 6)) .Select

.Interior.ColorIndex = 19 End With

Else

.Interior.ColorIndex = 19 End With End If End Sub

0 0

Post a comment