ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Correct syntax for hiding a chart sheet (https://www.excelbanter.com/excel-programming/387506-correct-syntax-hiding-chart-sheet.html)

Brad

Correct syntax for hiding a chart sheet
 
What is the correct syntax in a macro for hiding a chart sheet?

Vergel Adriano

Correct syntax for hiding a chart sheet
 
Brad,

One way: to hide a chart sheet named Chart1

Sheets("Chart1").visible=xlSheetHidden


--
Hope that helps.

Vergel Adriano


"Brad" wrote:

What is the correct syntax in a macro for hiding a chart sheet?


Brad

Correct syntax for hiding a chart sheet
 
Sheets("chart5").Visible = False

gives me a subscript out of range runtime error 9

"Vergel Adriano" wrote:

Brad,

One way: to hide a chart sheet named Chart1

Sheets("Chart1").visible=xlSheetHidden


--
Hope that helps.

Vergel Adriano


"Brad" wrote:

What is the correct syntax in a macro for hiding a chart sheet?


JE McGimpsey

Correct syntax for hiding a chart sheet
 
Check your chart sheet title - are there any additional spaces (e.g.,
"Chart 5", "Chart 5 ")?

You could (and in most cases, *should*) use the CodeName:

Chart1.Visible = xlSheetHidden



In article ,
Brad wrote:

Sheets("chart5").Visible = False

gives me a subscript out of range runtime error 9

"Vergel Adriano" wrote:

Brad,

One way: to hide a chart sheet named Chart1

Sheets("Chart1").visible=xlSheetHidden



All times are GMT +1. The time now is 08:55 AM.

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