Chart Macro

  • Thread starter Thread starter Broxterman
  • Start date Start date
B

Broxterman

Hello,
I am having trouble creating a macro that will extract data from on
page of a worksheet and then create a pie chart on another page. Th
problem occurs when I attempt to resize the chart to fit in
designated area. Any help would be greatly appreciated.

Page 2:
Data to be extracted from cells B34:C39.

Page 1:
Create Pie chart with chart name "Data."
No legend.
Show "Label and Percent" for labels.
Chart should fill F7:J18 and be as large as possible
 
Turn on the macro recorder and do it manually. Then generalize the code to
suit your needs.
 
I have done that already. My macro will create the chart on the pag
that I want, but it will not allow me to resize it to fit in the area
want. I don't know what code to use to resize the chart to fit in th
desired area.

Is there a way to assign a chart to a specified area?
Again thank you for your assistanc
 
With Activesheet.ChartObjects(1)
.Left = Range("B9").Left
.Top = Range("B9").Top
.Width = Range("M20").Left - Range("B9").Left
.Height = Range("M20").Top - Range("B9").Top
End With
 

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

Back
Top