VBA properties of Charts

Gates Is Antichrist

Well-known Member
Joined
Aug 15, 2002
Messages
1,961
Forgive me for I am stumbling through an assignment using charts, so I may misstate or babble here :(

I have a chart that I want a dynamic title on. Thus I believe that I want to plug activechart.charttitle.caption based on input assumptions.

What I'm wondering is how to identify the chart itself. From the 'Chart Window' (from right clicking an empty area of the chart), I see one possible name in the title bar; from activechart.parent.name in Watch window I see "Chart 1" . So for starters I don't know the name of my only chart!

At ANY rate Charts.Count is zero! Charts(1) and charts("Chart 1") are rejected by the Watch window.

Going back to how I started, I guess I'll be okay if I can just know how to make my [sole] chart the "ActiveChart" but beyond that I'm quite clueless. (I don't want to have to manually click the chart to do so either.) Can someone walk me through what I need to do, if this is clear enough?

TIA
 
tusharm said:
Jon Peltier said:
I notice that this group is quick to jump on a VBA approach to things, where a more simple worksheet solution would suffice.
LOL! That's a lost cause. Leonardo da Vinci would not be very popular around here.

Good evening Gentlemen,

My advice regarding these sentiments is to search through the posts of the top posters here:

http://www.mrexcel.com/board2/statistics.php

Numbers 1, 3, 5, 6 in particular (10% of all posts, and others on this list have recommended non-vb solutions throughout history :wink: ). Construct a graph on the number of vb related responses relative to non-vb related responses. Your picture (worth a 1,000 words I'm told :) ) should, I believe, contradict what you've just posted. :) In fact, I'll quote Mark W.,

Mark W. said:
I've been using Excel since the mid-80's. I see VBA as an after thought.
Either way, I agree with Mark O'Brien, two great sites indeed! :)
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Nate -

I'm not denying that a lot of non-vba suggestions have been made over the years. I make tons of them myself. My point (and I think Tushar's as well) is that oftentimes non-vba solutions that to me seem obvious are not among the first few responses. Maybe you're saying that 90% of the responses are non-vba, and I'm saying why isn't it 95%.

In truth, the best solutions are those that use the strengths of non-vba and vba appropriately. I had to learn the hard way, for example, not to build a whole workbook from scratch in vba, but instead use vba to create the workbook based on a well crafted template, which already included dynamic ranges and elaborate charts.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______
 
Upvote 0
NateO said:
http://www.mrexcel.com/board2/statistics.php

Numbers 1, 3, 5, 6 in particular (10% of all posts, and others on this list have recommended non-vb solutions throughout history :wink: ). Construct a graph on the number of vb related responses relative to non-vb related responses. Your picture (worth a 1,000 words I'm told :) ) should, I believe, contradict what you've just posted. :)
LOL! There have been any number of instances when I have wished I had the skill you just demonstrated.

That's a slick response that would make anyone in Washington (or in public relations) proud. And, excluding #7 on the Top 10 list was a stroke of genius (or a measure of desperation?). :)

But, as Jon pointed out, you are posing a question quite different from the one that should be addressed. The correct statistic to gather would be "how many questions that are answered with a VBA solution could have used a (simpler) non-VBA solution?"
 
Upvote 0
"a (simpler) non-VBA solution?"


This is just an appeal for the above not be be the start of a debate about the definition of simplicity in this context :LOL:
 
Upvote 0
Good Evening,

Jon Peltier said:
Maybe you're saying that 90% of the responses are non-vba, and I'm saying why isn't it 95%.

In truth, the best solutions are those that use the strengths of non-vba and vba appropriately. I had to learn the hard way, for example, not to build a whole workbook from scratch in vba, but instead use vba to create the workbook based on a well crafted template, which already included dynamic ranges and elaborate charts.
I concur, I tend to actively use both in my Excel oriented affairs and I see what you're saying. I think the nature of the responses tend to be the result of:

1) Who's responding.
2) The Question.

Take the following for example:

http://www.mrexcel.com/board2/viewtopic.php?t=60782

I can't even be sure as to what this individual is asking. And I'm sure concatenating the ranges via functions would suffice nicely. But they asked a Vb related question, much like how this thread originated, and I opted to provide a vb related answer. Do I always give the OP exactly what they ask for, no, e.g.,

http://www.mrexcel.com/board2/viewtopic.php?t=48065

But every now & then I simply respond to the literal question, as I'm sure a lot of vb fans do in kind with respect to vb related queries, whether the method is optimal or not (often times, the entire goal set is not so transparent)... Interesting point though.

tusharm said:
LOL! There have been any number of instances when I have wished I had the skill you just demonstrated.

That's a slick response that would make anyone in Washington (or in public relations) proud. And, excluding #7 on the Top 10 list was a stroke of genius (or a measure of desperation?).
Thanks! I'm working on my diplomacy. I thought leaving #8 off the list was quite appropriate (as alluded to). :biggrin: And you're correct, I was responding more to the direct statement I quoted versus addressing the appropriateness of initial responses as a whole.

I should mention while I'm posting that my initial intent was to concur with Mark O'Brien regarding the quality nature of Jon & Tushar's sites, but I also wanted to add another element to the dialogue, if you will. :biggrin:

PaddyD said:
This is just an appeal for the above not be be the start of a debate about the definition of simplicity in this context :LOL:
What on Earth could you be talking about? :LOL:

I'm not adding much value to this thread, but your responses merited a follow-up. Have a good one. :)
 
Upvote 0
I think we're all in general agreement. My point in the first place was probably a plea to Keep It Simple Stupid. Although, you're right, sometimes the person asking the question really wants something specific; I just spent a while giving a guy SUBTOTAL(), then array functions, then finally a custom UDF to subtotal a range. And on the other hand, often a person will be more grateful to see how easy something is in the GUI than merely to have a piece of code to ponder.

My daughter would sum it up like this: What-ever.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

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
Back
Top