Loading
Ozgrid Excel Help & Best Practices Forums

Excel Training / Excel Dashboards Reports



Results 1 to 4 of 4

Thread: Define the size of plot area

  1. #1
    Join Date
    10th September 2005
    Posts
    87

    Define the size of plot area

    Hi,

    I draw 10 charts on one sheet, How can I define the size of the plot area of every chart so that every one has the same size. I double click the plot area, only "patterns" and "area" can select.

    Thanks for the help.

    Linda

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    28th June 2005
    Location
    Lincolnshire, UK
    Posts
    1,139

    Re: Define the size of plot area

    this code will change the width of the plot area on all charts on the sheet. Just change as required.

    Code:
    Sub Macro1()
    Dim sh As Shape
    For Each sh In ActiveSheet.Shapes
    
        ActiveSheet.ChartObjects(sh.Name).Activate
        ActiveChart.PlotArea.Width = 100
    Next sh
    
    End Sub
    Not tested but shoud work
    Rich

    www.imits.co.uk - for all your training and development needs!

  3. #3
    Join Date
    10th September 2005
    Posts
    87

    Re: Define the size of plot area

    Thanks! I will try it.

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    7th March 2003
    Location
    Essex, England
    Posts
    11,310

    Re: Define the size of plot area

    Hi,

    Although Badger101's code will work it will fail if the sheet has any shapes on it.
    Try this just for chart objects.
    Note that the width will actually only be set to 100 if there is enough room within the chartarea to do it.
    [vba]Sub Macro1()

    Dim objCht As ChartObject

    For Each objCht In ActiveSheet.ChartObjects
    objCht.Chart.PlotArea.Width = 100
    Next

    End Sub[/vba]

    Cheers
    Andy


Thread Information

Users Browsing this Thread

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

Possible Answers

  1. Automatically Define Print Area Before Printing
    By ozastudent in forum EXCEL HELP
    Replies: 4
    Last Post: August 18th, 2007, 22:28
  2. Charts: Scaling And Maximizing Plot Area
    By markc in forum EXCEL HELP
    Replies: 2
    Last Post: October 29th, 2006, 00:50
  3. Incorrect Plot Order: Area Chart
    By MNTye in forum EXCEL HELP
    Replies: 9
    Last Post: October 27th, 2006, 23:17
  4. Plot area image = Picture Box???
    By milkburp in forum EXCEL HELP
    Replies: 10
    Last Post: July 22nd, 2006, 11:15
  5. Charts: conditionally format the plot area
    By fliss in forum EXCEL HELP
    Replies: 2
    Last Post: November 22nd, 2003, 00:34

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
  •  
porno