#1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Histogram in Excel

I have written a macro that uses the data-analysis tool to creat a
histogram. It turns out too small and I have to manually enlarge it. I
can't seem to do it in the macro, because one has to select thee chart
and I can't figure out how to do this since it reuires a chart number
to select it. And of course the number changes every time the macro is
run.

So my question is: In a VBA macro how do I select the only chart when
I will not know it's number. Help will be appreciated. Thank you.

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Histogram in Excel

Hi,

Some like this will select the most recent chart object on the activesheet.


Dim objCht as ChartObject

set objCht = activesheet.chartobjects(activesheet.chartobjects. count)
objcht.width = 350
objcht.height = 250


Cheers
Andy

jtomdd wrote:
I have written a macro that uses the data-analysis tool to creat a
histogram. It turns out too small and I have to manually enlarge it. I
can't seem to do it in the macro, because one has to select thee chart
and I can't figure out how to do this since it reuires a chart number
to select it. And of course the number changes every time the macro is
run.

So my question is: In a VBA macro how do I select the only chart when
I will not know it's number. Help will be appreciated. Thank you.

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 762
Default Histogram in Excel

jtomdd -

If you do the resizing immediately after the chart is created, maybe you
could use ActiveChart to refer to it.

Instead of using the Histogram tool of the Analysis ToolPak, you may want to
investigate the VBA code of my free Better Histogram add-in, available from
http://www.treeplan.com.

- Mike
http://www.mikemiddleton.com


"jtomdd" wrote in message
oups.com...
I have written a macro that uses the data-analysis tool to creat a
histogram. It turns out too small and I have to manually enlarge it. I
can't seem to do it in the macro, because one has to select thee chart
and I can't figure out how to do this since it reuires a chart number
to select it. And of course the number changes every time the macro is
run.

So my question is: In a VBA macro how do I select the only chart when
I will not know it's number. Help will be appreciated. Thank you.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
unhide menu bar in excel - just disappeared Sean Setting up and Configuration of Excel 12 April 4th 23 10:19 AM
formula structure building ? check under the excel forum.... 4pinoy Excel Discussion (Misc queries) 2 November 16th 06 03:40 PM
enable automatic refresh Vass Excel Worksheet Functions 2 March 11th 06 04:36 AM
Histogram - Excel doesn't accept my bin values, uses default GroovySpreadsheetGuy Excel Discussion (Misc queries) 0 November 29th 05 04:59 PM


All times are GMT +1. The time now is 03:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"