Hello,
I am working with an Excel sheet.
I need to open a window displaying something whenever i click on a bar in a bar chart.
Is this possible?
Printable View
Hello,
I am working with an Excel sheet.
I need to open a window displaying something whenever i click on a bar in a bar chart.
Is this possible?
ok.. this took a bit of work to figure out... but I got it
add this code to the sheet that contains the chart
switch to another sheet.... then back to the sheet
now click one of the bars..
VB Code:
Dim WithEvents cht As Chart Private Sub cht_Select(ByVal ElementID As Long, ByVal Arg1 As Long, ByVal Arg2 As Long) Select Case Arg1 Case 1 MsgBox "Picked series 1" Case 2 MsgBox "Picked series 2" Case Else MsgBox "Picked series " & Arg1 End Select End Sub Private Sub Worksheet_Activate() Set cht = ChartObjects(1).Chart End Sub
thanks for your code, has worked very well!
Gald to hear it!!
oh.. and http://www.vbforums.com/