Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

graphs

ResolvedVersion 2003

James has attended:
Access VBA course
Excel VBA Advanced course

Graphs

Afer making a graph and displaying it on the sheet with the data table. Is there a way of positioning and sizing the graph in vba.

RE: Graphs

Hi James

Thank you for your question

The following code will size and position a chart once it is created

With aChart


.ChartArea.Width = 600
.ChartArea.Height = 400


With .Parent

.Top = Range("K21").Top
.Left = Range("K21").Left


End With


End With

The size of the chart can be altered by using the width and height properties of the chartarea object.

The position of the chart is fixed by using the top and left properties of the chart'sm parent object. This refers to the worksheet that the chart is located in.

Hope this helps

Regards

Stephen

Mon 12 Jan 2009: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Wrapping Text in a Cell in an Excel 2010 Workbook

When you have a lot of text you want to put in a particular cell but you can't decrease the font size to fit because the text will then become ineligible, then manually wrap the text in a cell by simply pressing ALT+ENTER.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.