ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   removing toolbars and taskbars from only one worksheet or workbook (https://www.excelbanter.com/excel-discussion-misc-queries/223044-removing-toolbars-taskbars-only-one-worksheet-workbook.html)

Jaytee

removing toolbars and taskbars from only one worksheet or workbook
 
I have created an app in excel, but need to have certain worksheets that do
not show the tool/task bars, or anything other than the content of the cells.
I do not wish to have this condition affect any other workbooks.

Shane Devenshire

removing toolbars and taskbars from only one worksheet or workbook
 
Hi,

Turn on the macro recorder and turn off all the items you don't want to
show, then stop the recorder. Repeat the recording process while turning all
the items back on.

You can attach the first recording to the Workbook_Activate procedure and
the second to the Workbook_Deactivate procedure.

Here is a sample:

Private Sub Workbook_Activate()
With ActiveWindow
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With
With Application
.DisplayFormulaBar = False
.DisplayStatusBar = False
.ShowWindowsInTaskbar = False
End With
End Sub

1. To add this code to your file, press Alt+F11,
2. In the VBAProject window, top left side, find your sheet name under your
file name and double click it.
3. Paste in or type the code above.
--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Jaytee" wrote:

I have created an app in excel, but need to have certain worksheets that do
not show the tool/task bars, or anything other than the content of the cells.
I do not wish to have this condition affect any other workbooks.


Gord Dibben

removing toolbars and taskbars from only one worksheet or workbook
 
Shane

Workbook_Activate will do nothing in a sheet module.

OP wanted "certain sheets" not all sheets.

I think OP should use Private Sub Worksheet_Activate() and Private Sub
Worksheet_Deactivate() in each of those "certain sheets"

Also, OP would need a method to switch sheets since the Sheet Tabs are
unavailable for selection.


Gord


On Wed, 4 Mar 2009 11:04:12 -0800, Shane Devenshire
wrote:

Hi,

Turn on the macro recorder and turn off all the items you don't want to
show, then stop the recorder. Repeat the recording process while turning all
the items back on.

You can attach the first recording to the Workbook_Activate procedure and
the second to the Workbook_Deactivate procedure.

Here is a sample:

Private Sub Workbook_Activate()
With ActiveWindow
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With
With Application
.DisplayFormulaBar = False
.DisplayStatusBar = False
.ShowWindowsInTaskbar = False
End With
End Sub

1. To add this code to your file, press Alt+F11,
2. In the VBAProject window, top left side, find your sheet name under your
file name and double click it.
3. Paste in or type the code above.




All times are GMT +1. The time now is 05:45 AM.

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