PC Review Forums Newsgroups Microsoft Excel Microsoft Excel Charting How to show Excel chart VBA 'name'?

Reply

How to show Excel chart VBA 'name'?

 
Thread Tools Rate Thread
Old 21-11-2003, 08:55 AM   #1
mbobro
Guest
 
Posts: n/a
Default How to show Excel chart VBA 'name'?



Hi,

I have several charts on every Excel Worksheet. I'd like to program VB
to select them. In order to do so, I need to know the 'name' of eac
chart.

How to display it quickly?

Maybe you know a kind of add-in that has a kind of nutton like 'sho
chart name'?

Thanks,


Micha

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  Reply With Quote
Old 21-11-2003, 11:22 AM   #2
Andy Pope
Guest
 
Posts: n/a
Default Re: How to show Excel chart VBA 'name'?

Hi Michal,

Just hold the Shift key before selecting the chart.
The name will be displayed in the Name Box (where the cell address is
normally displayed)

mbobro wrote:
> Hi,
>
> I have several charts on every Excel Worksheet. I'd like to program VBA
> to select them. In order to do so, I need to know the 'name' of each
> chart.
>
> How to display it quickly?
>
> Maybe you know a kind of add-in that has a kind of nutton like 'show
> chart name'?
>
> Thanks,
>
>
> Michal
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>


--

Cheers
Andy

http://www.andypope.info

  Reply With Quote
Old 21-11-2003, 06:14 PM   #3
Jon Peltier
Guest
 
Posts: n/a
Default Re: How to show Excel chart VBA 'name'?

You might not even need the names.

To loop through the charts one by one, use a construction like this:

Dim oChtOb as ChartObject
For Each oChtOb in ActiveSheet.ChartObjects
' Do your stuff to oChtOb or to its chart, oChtOb.Chart
Next

To select all charts, use:

ActiveSheet.ChartObjects.Select

In general, you don't even need to select a chart to change it. Just
refer to the part that needs adjusting:

oChtOb.Chart.Axes(2,1).MaximumScale = 100

When using recorded macros, everywhere you see this:

SomeObject.Select
Selection.DoSomething

you can streamline things with this:

SomeObject.DoSomething

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

mbobro wrote:

> Hi,
>
> I have several charts on every Excel Worksheet. I'd like to program VBA
> to select them. In order to do so, I need to know the 'name' of each
> chart.
>
> How to display it quickly?
>
> Maybe you know a kind of add-in that has a kind of nutton like 'show
> chart name'?
>
> Thanks,
>
>
> Michal
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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

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