Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Anpu Massri   on Nov 05 In MS Office Category.

  
Question Answered By: Anuja Shah   on Nov 05

Try (in Excel97):

SheetName = ActiveSheet.Name

Range1.Select

Charts.Add
ActiveChart.ChartType = xlPie
ActiveChart.Location Where:=xlLocationAsObject, Name:=SheetName
ActiveWindow.Visible = False

Notice that I didn't use the

ActiveChart.SetSourceData line

This probably works because the data  region is simple and Excel
"defaults" to want you want in that case.

You can skip "Set Range1 = ActiveCell.CurrentRegion" and just use
ActiveCell.CurrentRegion.Select, if you want.

Share: 

 
 
Didn't find what you were looking for? Find more on Specifying a range chosen at run time Or get search suggestion and latest updates.


Tagged: