ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Chart to be first sheet to open (https://www.excelbanter.com/excel-discussion-misc-queries/156557-chart-first-sheet-open.html)

gazza67[_2_]

Chart to be first sheet to open
 
Hi,

I have a workbook with many sheets. I can make any worksheet I want to
be the initial sheet to be opened when the document is opened, HOWEVER
I want to make a chart the initial sheet to open and I cant make this
work.

I am running excel2000

Cheers,
Gazza


Tevuna

Chart to be first sheet to open
 
Paste this into the workbook code area:

Private Sub Workbook_Open()
Sheets("ChartName").Activate
End Sub

Make sure that:
1. You paste it into the workbook code window, not in a module.
2. Macros are set to run when workbook opens.




"gazza67" wrote:

Hi,

I have a workbook with many sheets. I can make any worksheet I want to
be the initial sheet to be opened when the document is opened, HOWEVER
I want to make a chart the initial sheet to open and I cant make this
work.

I am running excel2000

Cheers,
Gazza



gazza67[_2_]

Chart to be first sheet to open
 
This only applies to worksheets, it would not work on a chartsheet.







On Aug 31, 1:50 pm, Tevuna wrote:
Paste this into the workbook code area:

Private Sub Workbook_Open()
Sheets("ChartName").Activate
End Sub

Make sure that:
1. You paste it into the workbook code window, not in a module.
2. Macros are set to run when workbook opens.

"gazza67" wrote:
Hi,


I have a workbook with many sheets. I can make any worksheet I want to
be the initial sheet to be opened when the document is opened, HOWEVER
I want to make a chart the initial sheet to open and I cant make this
work.


I am running excel2000


Cheers,
Gazza




Jon Peltier

Chart to be first sheet to open
 
It does work with a chart sheet (I just tested it to be sure). Where did you
put the code?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"gazza67" wrote in message
ups.com...
This only applies to worksheets, it would not work on a chartsheet.







On Aug 31, 1:50 pm, Tevuna wrote:
Paste this into the workbook code area:

Private Sub Workbook_Open()
Sheets("ChartName").Activate
End Sub

Make sure that:
1. You paste it into the workbook code window, not in a module.
2. Macros are set to run when workbook opens.

"gazza67" wrote:
Hi,


I have a workbook with many sheets. I can make any worksheet I want to
be the initial sheet to be opened when the document is opened, HOWEVER
I want to make a chart the initial sheet to open and I cant make this
work.


I am running excel2000


Cheers,
Gazza






gazza67[_2_]

Chart to be first sheet to open
 
I put it in the workbook code window (in the title bar for the window
it says Microsoft Visual Basic - MyBookName.xls - [ThisWorkbook(code)]

If I modify the code and put a normal worksheet in it works as
expected, if I change the code to the name of a chartsheet I get

Run-time error '9':
Subscript out of range

Gary



On Sep 2, 6:30 am, "Jon Peltier"
wrote:
It does work with a chart sheet (I just tested it to be sure). Where did you
put the code?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

"gazza67" wrote in message

ups.com...

This only applies to worksheets, it would not work on a chartsheet.


On Aug 31, 1:50 pm, Tevuna wrote:
Paste this into the workbook code area:


Private Sub Workbook_Open()
Sheets("ChartName").Activate
End Sub


Make sure that:
1. You paste it into the workbook code window, not in a module.
2. Macros are set to run when workbook opens.


"gazza67" wrote:
Hi,


I have a workbook with many sheets. I can make any worksheet I want to
be the initial sheet to be opened when the document is opened, HOWEVER
I want to make a chart the initial sheet to open and I cant make this
work.


I am running excel2000


Cheers,
Gazza




Jon Peltier

Chart to be first sheet to open
 
Go back to Tevuna's original response. Did you paste the code exactly as is?
Did you then change to the correct chart sheet name, in quotes? If not, you
will get the RTE 9 Subscript error you report. Note that the default name
"Chart1" has no space before the number.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"gazza67" wrote in message
ups.com...
I put it in the workbook code window (in the title bar for the window
it says Microsoft Visual Basic - MyBookName.xls - [ThisWorkbook(code)]

If I modify the code and put a normal worksheet in it works as
expected, if I change the code to the name of a chartsheet I get

Run-time error '9':
Subscript out of range

Gary



On Sep 2, 6:30 am, "Jon Peltier"
wrote:
It does work with a chart sheet (I just tested it to be sure). Where did
you
put the code?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

"gazza67" wrote in message

ups.com...

This only applies to worksheets, it would not work on a chartsheet.


On Aug 31, 1:50 pm, Tevuna wrote:
Paste this into the workbook code area:


Private Sub Workbook_Open()
Sheets("ChartName").Activate
End Sub


Make sure that:
1. You paste it into the workbook code window, not in a module.
2. Macros are set to run when workbook opens.


"gazza67" wrote:
Hi,


I have a workbook with many sheets. I can make any worksheet I want
to
be the initial sheet to be opened when the document is opened,
HOWEVER
I want to make a chart the initial sheet to open and I cant make
this
work.


I am running excel2000


Cheers,
Gazza






gazza67[_2_]

Chart to be first sheet to open
 
Jon and Tevuna,

Thanks for you help. My problem was that I was using the statement
WorkSheets("ChartName").Activate .

This statement works fine for worksheets but throws the RTE 9 error
when applied to a chart.

I needed the statement
Sheets("ChartName").Activate .
Which Tevuna correctly supplied, once again,

THANKs


On Sep 5, 10:38 pm, "Jon Peltier"
wrote:
Go back to Tevuna's original response. Did you paste the code exactly as is?
Did you then change to the correct chart sheet name, in quotes? If not, you
will get the RTE 9 Subscript error you report. Note that the default name
"Chart1" has no space before the number.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______

"gazza67" wrote in message

ups.com...

I put it in the workbook code window (in the title bar for the window
it says Microsoft Visual Basic - MyBookName.xls - [ThisWorkbook(code)]


If I modify the code and put a normal worksheet in it works as
expected, if I change the code to the name of a chartsheet I get


Run-time error '9':
Subscript out of range


Gary


On Sep 2, 6:30 am, "Jon Peltier"
wrote:
It does work with a chart sheet (I just tested it to be sure). Where did
you
put the code?


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -http://PeltierTech.com
_______


"gazza67" wrote in message


roups.com...


This only applies to worksheets, it would not work on a chartsheet.


On Aug 31, 1:50 pm, Tevuna wrote:
Paste this into the workbook code area:


Private Sub Workbook_Open()
Sheets("ChartName").Activate
End Sub


Make sure that:
1. You paste it into the workbook code window, not in a module.
2. Macros are set to run when workbook opens.


"gazza67" wrote:
Hi,


I have a workbook with many sheets. I can make any worksheet I want
to
be the initial sheet to be opened when the document is opened,
HOWEVER
I want to make a chart the initial sheet to open and I cant make
this
work.


I am running excel2000


Cheers,
Gazza





All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com