#1   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default Hiding charts

Please help me with a vba program that will hide and show on command.
Thanks


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Hiding charts


Some good advice here...
http://www.cpearson.com/excel/newposte.htm

Assume you are referring to a fairly recent version of Excel,
(but not xl2007), running on Windows.
Also that the chart is an embedded chart on a worksheet, not a
separate chart sheet, then...

With ActiveSheet.ChartObjects("MyChartName")
.Visible = Not .Visible
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"dan"
wrote in message
Please help me with a vba program that will hide and show on command.
Thanks


  #3   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default Hiding charts

Thank you, Jim

"Jim Cone" wrote in message
...

Some good advice here...
http://www.cpearson.com/excel/newposte.htm

Assume you are referring to a fairly recent version of Excel,
(but not xl2007), running on Windows.
Also that the chart is an embedded chart on a worksheet, not a
separate chart sheet, then...

With ActiveSheet.ChartObjects("MyChartName")
.Visible = Not .Visible
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"dan"
wrote in message
Please help me with a vba program that will hide and show on command.
Thanks




  #4   Report Post  
Junior Member
 
Location: Winters CA
Posts: 22
Default

I assume from the title you mean hide/unhide charts. The format menu has a Chart - Hide option.
If your chart is imbedded on sheet1, this routine will toggle its visiblity
Code:
Sub toggleImbeddedChart()
With ThisWorkbook.Worksheets("sheet1").ChartObjects("chart 1")
    .Visible = Not (.Visible)
End With
End Sub
This will toggle a chart sheet.
Code:
Sub toggleChartSheet()
With ThisWorkbook.Sheets("Chart1")
    .Visible = Not (.Visible)
    .Activate
End With
End Sub

Quote:
Originally Posted by dan View Post
Please help me with a vba program that will hide and show on command.
Thanks
  #5   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 38
Default Hiding charts

Very nice! Thank you, Mike

"mikerickson" wrote in message
...

I assume from the title you mean hide/unhide charts. The format menu has
a Chart - Hide option.
If your chart is imbedded on sheet1, this routine will toggle its
visiblity

Code:
--------------------
Sub toggleImbeddedChart()
With ThisWorkbook.Worksheets("sheet1").ChartObjects("ch art 1")
.Visible = Not (.Visible)
End With
End Sub
--------------------

This will toggle a chart sheet.

Code:
--------------------
Sub toggleChartSheet()
With ThisWorkbook.Sheets("Chart1")
.Visible = Not (.Visible)
.Activate
End With
End Sub
--------------------



dan;510529 Wrote:
Please help me with a vba program that will hide and show on command.
Thanks





--
mikerickson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Charts curious engineer Charts and Charting in Excel 1 May 24th 07 04:57 PM
hiding unused categories in charts Compensation Analyst Excel Discussion (Misc queries) 1 March 19th 07 09:22 PM
hiding charts w/o data spence Excel Worksheet Functions 0 March 23rd 06 10:49 PM
hiding zero values in stacked bar charts WSU Cougar Charts and Charting in Excel 3 February 4th 06 08:19 PM
hiding zero values in charts fascal Charts and Charting in Excel 4 December 19th 05 02:17 PM


All times are GMT +1. The time now is 03:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"