Hide Sheet Tab

Andrew

New Member
Joined
Mar 2, 2002
Messages
30
Dear All,
Could anyone show me how to write a macro to hide the sheets tab and also un-hiding them??
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Recording myself hiding and unhiding the tabs via the Options View menu (always the best way to find out), gave: -
<pre>
Sub Macro3()

ActiveWindow.DisplayWorkbookTabs = False
ActiveWindow.DisplayWorkbookTabs = True

End Sub
</pre>
 
Upvote 0
I'm a little confused. You don't need to use a macro do to this. You can just go to Format|Sheet|Hide (or unhide).

Basically, I'm just not certain if you're aware of that, or if you want a macro to do it for some other reason. :confused:

But hope it helps, anyway.

_________________<font color="#3399FF" size="3">Kristy</font>
kitten_smush2.jpg

This message was edited by Von Pookie on 2002-10-22 10:04
 
Upvote 0
To hide 'em, you can use:<pre>
ActiveWindow.DisplayWorkbookTabs = False</pre>

to make 'em visible again you can use:<pre> ActiveWindow.DisplayWorkbookTabs = True</pre>

OR, if you want to be a fancy pants using 1 button:<pre>
ActiveWindow.DisplayWorkbookTabs = Not(ActiveWindow.DisplayWorkbookTabs)</pre>

HTH

EDIT:: Mudface, I used the recorder as well :)
_________________<font color = green> Mark O'Brien
This message was edited by Mark O'Brien on 2002-10-22 10:05
 
Upvote 0
To add

its worth remembering you mush have one tab showing at all times regardless, BUT you can hide that oone by un tick tools options tabs,

If you hide all in VBE and write the code it will fault!!

Jack
 
Upvote 0
How about trying this:

Sheets("SheetName").Visible = False

You can place it in a macro or a control (button).
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,429
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top