"Pick and choose" series to display on embedded chart

mae0429

Board Regular
Joined
Jun 12, 2008
Messages
114
Hi all,

I posted this in the VBA Express forum yesterday:
http://www.vbaexpress.com/forum/showthread.php?t=20540

I've got some data that when all is said and done, it consists of 6 groups of 6 ranges (with variability in the number of cells in those ranges). Currently, I'm displaying them as 36 separate charts on the same worksheet. Is it possible to add 6 checkboxes to a chart that would allow for selection of a range to make a series? This way, I could narrow this to 6 charts, making it a little more useful to my end user.

I started on it some, but obviously I cannot refer to the chart with the object "Frame1" because it won't support that property. Any ideas how to go about this? (I don't want the whole "user form w/ picture" solution, please)


It hasn't been addressed really, and I would like to know if this is possible to do by hard-coding. The charts are created at run-time and I don't want to have to go in after the fact to create buttons everytime this is run (which is going to be a lot...plus, it's not going to be me who's running the macro).


The code I've been trying to use for creating the checkboxes is:
Rich (BB code):
Set Frame1 = Worksheets(activeShtName).ChartObjects(a) 
For idx = 1 To 6 
    Set chk = Frame1.Controls.Add("Forms.CheckBox.1", "CheckBox" & idx, True) 
    chk.Left = 5 
    chk.Top = (idx - 1) * (chk.Height + 2) 
    chk.Caption = "CheckBox " & idx 
Next idx


Thanks!
-Matt
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
To position a CheckBox from the Forms Toolbar at the top left of a Chart:

Code:
Sub Test()
    Dim ChObj As ChartObject
    Set ChObj = ActiveSheet.ChartObjects(1)
    ActiveSheet.CheckBoxes.Add ChObj.Left, ChObj.Top, 81, 17.25
End Sub
 
Upvote 0

Forum statistics

Threads
1,191,670
Messages
5,987,953
Members
440,121
Latest member
eravella

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top