Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default macro to auto-veryhide

Howdee all.
Hope everyone had a great weekend.
I'm looking to work through a series of workbooks that have numerous-- and I
mean lots-- of hidden tabs.
My goal is to xlveryhidden all hidden tabs, so that other users who don't
have the need can't access a hidden tab.

My initial thoughts on this have been-

if worksheet.visibility = xlhidden then
worksheet.visibility = xlveryhidden.

My problem is that when I've tried this, it'd hang up, or give me an error.
I'm sure that it's something real simple, but so far I haven't been able to
make it work.

And yes, I'd be using a for loop to work through all the hidden tabs in a
given file.

Thank you.
Best.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default never mind- I got it.

Never mind. I figured it out.
Gee... now wasn't that an easy one to answer? ;-)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default never mind- I got it.

"Steve" wrote in message
...
Never mind. I figured it out.
Gee... now wasn't that an easy one to answer? ;-)



Steve,

In the future, if you arrive at a solution before others have responded to
your thread, it would be helpful if you posted your solution so others who
have similar problems could benefit from it.

For this particular thread it is no longer necessary since Don has provided
a working solution.

Skiffle

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default never mind- I got it.

Sorry 'bout that Skiff. I was working on multiple things last night and
forgot..... I normally do this, so here it is.

Sub VryHideShts()
'is macro is to very hide unwanted worksheets.
' HideSheet Macro

Dim sh As Worksheet
For Each sh In Worksheets
'sh.Select
If sh.Visible = 0 Then
sh.Visible = 2
'Else: MsgBox "No tabs to hide.", vbCritical, "Error"
End If
Next
End Sub


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default macro to auto-veryhide

Hi Don.
Thanks for both the veryhide, and the unhide code. It'll definitely come in
handy.

Best.


"Don Guillett" wrote:

Sub makeverhidden()
For Each sh In Worksheets
If sh.Visible = False Then sh.Visible = xlVeryHidden
Next sh
End Sub
Sub unhidesheets()
For Each sh In Worksheets
sh.Visible = True
Next sh
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Steve" wrote in message
...
Howdee all.
Hope everyone had a great weekend.
I'm looking to work through a series of workbooks that have numerous-- and
I
mean lots-- of hidden tabs.
My goal is to xlveryhidden all hidden tabs, so that other users who don't
have the need can't access a hidden tab.

My initial thoughts on this have been-

if worksheet.visibility = xlhidden then
worksheet.visibility = xlveryhidden.

My problem is that when I've tried this, it'd hang up, or give me an
error.
I'm sure that it's something real simple, but so far I haven't been able
to
make it work.

And yes, I'd be using a for loop to work through all the hidden tabs in a
given file.

Thank you.
Best.


.

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
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Auto-run macro after auto-query refresh (Excel2000,sr1) Bill Cufflin Excel Programming 3 June 29th 06 03:30 AM
Macro Auto Run(2) Gary Excel Worksheet Functions 4 May 18th 06 09:07 AM
Auto-run ONCE macro CLR Excel Programming 9 October 12th 03 03:23 AM


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

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

About Us

"It's about Microsoft Excel"