|
-
May 24th, 2006, 03:02 AM
#1
Thread Starter
New Member
Opening a window clicking on a bar in a bar chart
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?
-
May 24th, 2006, 08:37 AM
#2
Re: Opening a window clicking on a bar in a bar chart
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
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
May 25th, 2006, 08:47 AM
#3
Thread Starter
New Member
Re: Opening a window clicking on a bar in a bar chart
thanks for your code, has worked very well!
-
May 25th, 2006, 09:16 AM
#4
Re: Opening a window clicking on a bar in a bar chart
Gald to hear it!!
oh.. and
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|