Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Randall
 
Posts: n/a
Default Custom Toolbar in Chart

How do you create a custom toolbar with a ComboBox that will be avaliable
when a chart is active?

I'd like to have a TOOLBAR where a ComboBox (or ListBox) is used to select a
variable. This would then change the source data for the chart. I've got
the code to change the chart, I just can't get a ComboBox in a Toolbar to
work properly when a chart is active.

Tx,
Randall
  #2   Report Post  
Tushar Mehta
 
Posts: n/a
Default

I'm not sure what you mean by "I just can't get a ComboBox in a Toolbar
to work properly when a chart is active." If you mean it should be
active only when a chart is...

One 'trick' is to create an event hook that ties to a toolbar button
that XL enables whenever a chart is the active element (if you can find
such a commandbar item). This technique is further explained in
Professional Excel Development by Bullen, Bovey, and Green.

Another approach would be to add to your ComboBox code something along
the lines of
If activechart is nothing then
msgbox "Sorry, please select a chart first"
exit sub
end if

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
How do you create a custom toolbar with a ComboBox that will be avaliable
when a chart is active?

I'd like to have a TOOLBAR where a ComboBox (or ListBox) is used to select a
variable. This would then change the source data for the chart. I've got
the code to change the chart, I just can't get a ComboBox in a Toolbar to
work properly when a chart is active.

Tx,
Randall

  #3   Report Post  
Jon Peltier
 
Posts: n/a
Default

Randall -

Less complicated than Tushar's suggestion is to use forms menu controls
(which include a listbox and a combobox) to select the variables. Forms
menu controls can be used in a chart sheet or in a worksheet, and they
link to worksheet ranges, so the chart can be dynamically controlled by
these controls without requiring VBA macros to be enabled.

See the Worksheet Controls for Chart Interactivity section of this web
page for a couple simple examples, which can be easily used with the
Dynamic Charts examples also on this page:

http://peltiertech.com/Excel/Charts/Dynamics.html

A more elaborate example is given in this article:

http://pubs.logicalexpressions.com/P...cle.asp?ID=246

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


Randall wrote:

How do you create a custom toolbar with a ComboBox that will be avaliable
when a chart is active?

I'd like to have a TOOLBAR where a ComboBox (or ListBox) is used to select a
variable. This would then change the source data for the chart. I've got
the code to change the chart, I just can't get a ComboBox in a Toolbar to
work properly when a chart is active.

Tx,
Randall

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom toolbar and macros MD Excel Discussion (Misc queries) 2 May 10th 05 05:31 PM
How do I save a custom toolbar? Art Kaufman Excel Discussion (Misc queries) 4 April 3rd 05 08:13 PM
Create a custom chart, two stacked bars/month w/ two axes? Oscar Charts and Charting in Excel 1 March 21st 05 11:07 PM
I would like to delete a custom toolbar from the workspace. How? twiga Setting up and Configuration of Excel 1 December 23rd 04 05:55 PM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM


All times are GMT +1. The time now is 12:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"