graphs

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Graphs

Graphs

resolvedResolved · Low Priority · Version 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:

Display Formulas Instead of Results in Excel 2010

By pressing Ctrl ~ once, Excel will display formulas rather than the results of the formulas. Press it again, and the results will appear again.

A much quicker and simpler way of displaying your formulas!

View all Excel hints and tips


Server loaded in 0.08 secs.