Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Check whether a named Chart 'Chart_01' is currently selected on the active worksheet

Dear Experts:

I got lots of column charts on the active worksheet.

The Charts are named 'Chart_01', 'Chart_02', 'Chart_03' and so forth.

I would like to have a code snippet with the following requirements:

The macro is to check whether the first chart, i.e. 'Chart_01' is selected. If yes or no, either way, a msgbox has to say so, i.e. either 'Chart_01' is selected or 'Chart_01' is not selected.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
SOLUTION
Avatar of krishnakrkc
krishnakrkc
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Andreas Hermle

ASKER

Dear both,

thank you very much for your swift response. I will check you codes tomorrow and then get back to you with a feedback.

Regards, Andreas
Hi m4trix,

yours is working just fine. Thank you very much.

Hi Kris, I am afraid to tell you that yours is somehow not working. Any idea why.

Regards, Andreas
Avatar of Saqib Husain
Hi Andreas, although I am not working on this one, a piece of advice is that "not working" does not help as far as troubleshooting is concerned. You could help Kris by specifiying where and how it does not work. Does not work could mean any or more of

- Runs but gives no results
- Runs and gives results but the results are wrong
- There are errors before running the code
- Runs but breaks (in which case you should specify the line number where it breaks)
Dear ssagibh:

you are absolutely right. I was in a hurry and did not specify where and how it does not work. Sorry about that!

And moreover, checking on Kris' code again, I noticed that his code works as well. I inadvertently ran another code instead of Kris' macro.

I really appreciate the professionalism of all  of you.

Regards, Andreas
Hi Kris and m4trix:

both code work just fine and use different approaches. This is a good way to learn from you.

Thank you very much for your professional support.

Regards, Andreas