Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

User selection from a chart

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Smith - 28 Jan 2008 16:19 GMT
I have a VB app that uses a VBA script to create a sheet with data and then
another sheet with a chart representing that data in graphical form.  The
sheet with the data on it has formulas that are run on a subset of the data.  
Currently these formulas are hardcoded with the range to calculate from.  But
I need to change it so the user can select a starting and ending point from
the chart (on the other page) that the formulas will use to calculate from.

I am new to Office scripting so any ideas on how to do this (if it's even
possible) would be helpful.

Thanks.
Jon Peltier - 29 Jan 2008 03:52 GMT
You can determine which chart element is selected using the Selection
object, but it's tedious to do this to get more than one selection, because
you have to make the user stop, select something else. then click something
to continue the code.

You can also use chart events to respond to mouse actions in the chart. It's
a bit tricky, especially if you've done little programming, but here's a
reasonably straightforward tutorial:

http://www.computorcompanion.com/LPMArticle.asp?ID=221

I've used this technique to do much the same as you, let the user easily
select the first and last point for detailed analysis.

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

>I have a VB app that uses a VBA script to create a sheet with data and then
> another sheet with a chart representing that data in graphical form.  The
[quoted text clipped - 11 lines]
>
> Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.