Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Hayrah Burki   on Sep 28 In MS Office Category.

  
Question Answered By: Amanda Carter   on Sep 28

When Excel creates worksheets and chart  it assigns a default name of
"worksheet" followed by a number. So the next sheet created will be
"worksheet" followed by number + 1.

Sheets("Chart1").Select

Refers to a specific sheet by name, alternatively you could use

Sheets(3).Select

To refer by position.

A better solution would be to rename the worksheet and chart after it is
created so you can refer to them by a specific name.

i = Sheets.Count
Sheets(i).Name = "PrimaryData"

Will rename the last worksheet in the workbook.

Play around with the macro  recorder to see how renaming works for the
worksheet and the chart.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 


Tagged: