+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    06-01-2009
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    11

    Change Chart Height

    How do I write a short piece of code that defines the specific height that I want to assign to a chart in Excel 2007?

    I have multiple charts on a sheet and I want to update the vertical heights of the charts depending on the value inputted to a cell in the sheet.

    Thanks
    Last edited by scorpio0077; 07-19-2009 at 04:32 PM.

  2. #2
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Change Chart Height

    Do you mean the height of the chart area or of the chartobject? If it's the latter, then a loop like:
    Code:
    Dim objChtObj as ChartObject
    For each objChtObj in Activesheet.chartobjects
       objChtObj.Height = Range("A1").Value
    Next objChtObj
    for example. Of course, you might want to move them too...
    So long, and thanks for all the fish.

  3. #3
    Registered User
    Join Date
    06-01-2009
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change Chart Height

    Hey romperstomper, Thanks for the reply. I did mean the Chart area and not the object.

  4. #4
    Registered User
    Join Date
    06-01-2009
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change Chart Height

    What I am looking for is a way to change the Axis Option > Maximum Height across multiple charts, namely

    Chart Tools > Format > Under Current Selection, choose Vertical (value) axis > Format Selection > Axis Option > Maximum Height.

    I would like to enter the Maximum Height in a cell and the Maximum Value has to change accordingly.

    Thanks!!

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,938
    Cheers
    Andy
    www.andypope.info

  6. #6
    Registered User
    Join Date
    06-01-2009
    Location
    Atlanta
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change Chart Height

    Thanks Andy!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0