Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > Control Excel charts using excel formulae


Reply
 
Thread Tools Display Modes
  #1  
Old 09-30-2008, 07:12 AM
jeeteshsingh jeeteshsingh is offline
Freshman
 
Join Date: Sep 2008
Posts: 27
Default Control Excel charts using excel formulae


Hi All,

Greatings!

Is there any possibility of controling excel charts using an excel formula?

I have dynamic values being populated in a table. If the table has two columns filled dynamically, I would need to show a bar graph. If there is only one column, I would need two show a Pie Graph instead of a bar graph.

Now since the values are being populated dynamically, I would need this display of graph to be dynamic.

Can this be controlled by a excel formulae?

Any inputs or ideas would be highly appreciated.

Thanks,
JT
Reply With Quote
  #2  
Old 09-30-2008, 08:42 AM
shg shg is offline
Junior Contributor

* Expert *
 
Join Date: May 2008
Posts: 297
Default

For sure you cannot do this with a formula.

I don't have a clue what the code would look like to change the graph, but would start by recording a macro to make the changes from one to the other, and then go from there.
__________________
Entia non sunt multiplicanda sine necessitate.
Reply With Quote
  #3  
Old 10-10-2008, 06:03 AM
davecurtis davecurtis is offline
Newcomer
 
Join Date: Oct 2008
Location: London
Posts: 3
Default

I do something like this just using a formula. If my imported data has two columns, a bar chart is plotted, and if there is only one column, then a pie chart is plotted. No VBA used at all.
I don't know how to attach a file here, but feel free to email me and I'll attach the file.
Reply With Quote
  #4  
Old 10-10-2008, 06:07 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline
Out Of Office

Retired Moderator
* Expert *
 
Join Date: Mar 2005
Location: London, UK
Posts: 3,398
Default

Welcome to the forum davecurtis.

Quote:
Originally Posted by datecurtis
I don't know how to attach a file here
To attach an excel file, please zip it first. When you post, click on the 'Go Advanced' button and then click on the Manage Attachments button in the additonal options section to browse and upload the zip file.

Quote:
Originally Posted by davecurtis
feel free to email me and I'll attach the file
Corresponding solutions via e-mail defeats the purpose of the public forum - I'm sure that lots of XVBT members would like to see your formula-only solution.

HTH,
COlin
__________________
RAD Excel Blog
Reply With Quote
  #5  
Old 10-10-2008, 08:14 AM
davecurtis davecurtis is offline
Newcomer
 
Join Date: Oct 2008
Location: London
Posts: 3
Default

Hi,

Thanks for the info Colin.
File attached.
I normally dump my data in the spreadsheet and toggle between scatter, column and box-whisker plots, depending what columns are filled, but I managed it with a pie chart and clustered column chart too.
Uncheck the box to simulate having no data for the second column, and the chart switches to a pie.

Dave
Reply With Quote
  #6  
Old 10-12-2008, 09:30 AM
shg shg is offline
Junior Contributor

* Expert *
 
Join Date: May 2008
Posts: 297
Default

Quote:
Originally Posted by shg
For sure you cannot do this with a formula.
I stand corrected. That's very clever, davecurtis, thank you.
__________________
Entia non sunt multiplicanda sine necessitate.
Reply With Quote
  #7  
Old 10-13-2008, 01:39 AM
davecurtis davecurtis is offline
Newcomer
 
Join Date: Oct 2008
Location: London
Posts: 3
Default

Thanks shg,
Glad to contribute for a change after learning so much from these forums.
Dave
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->