make macros in charts

J

jana

can someone tell me how to make a macro that will work in a chart,
specifically how to format a chart to format the chart and plot areas, and
properties (do not move/size with chart). I tried to create the macro, but
I get errors.
thanks!
 
A

Andy Pope

Hi,

It would help if you explained what the errors where and also shown your
code.

This code will set Don't Move and size property of chartobject as well as
set plotarea to automatic border and fill.
'--------------------------
Sub Macro1()
'
With ActiveSheet.ChartObjects(1)
' don't move and size chart object
.Placement = xlFreeFloating
With .Chart
With .PlotArea
.Border.LineStyle = xlAutomatic
.Interior.ColorIndex = xlAutomatic
End With
End With
End With

End Sub
'----------------------

Cheers
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top