LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 577
Default Hide a sheet with a variable name

Héctor

Thanks a lot it works perfectly

Scott

"Héctor Miguel" wrote:

hi, Scott !

Thanks for the code it works quite well.
I extended and moved the range from B3:B4 to A3:A10 and it still worked fine.
However it (un)hides all the sheets in the range.
What I need to do is be able to show/hide individual sheets (names in range A3:A10)
depnding on whether or not the corresonponing target cell in range B3:10 has an entry?
ie if B7 is a null value (which is the default) then hide the sheet name, based on A7


perhaps...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
Application.ScreenUpdating = False
If Intersect(Target, Range("b3:b10")) Is Nothing Then Exit Sub
For Each myCell In Intersect(Target, Range("b3:b10"))
Worksheets(myCell.Offset(, -1).Text).Visible = myCell < ""
Next
End Sub

hth,
hector.





 
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
How To make a sheet reference Variable (eq: sum(sheet!D2:H2)) John Linker Excel Discussion (Misc queries) 3 June 16th 08 11:29 PM
Create Sheet, Hide Sheet Dave Excel Discussion (Misc queries) 2 October 30th 07 03:40 PM
using sheet-variable in function [email protected] Excel Worksheet Functions 1 May 5th 06 02:11 PM
Variable sheet and Formula Sheet Emmett423 Excel Discussion (Misc queries) 2 March 31st 06 02:14 AM
variable in a link where the variable is the name of the sheet darrelly Excel Worksheet Functions 1 October 7th 05 08:24 AM


All times are GMT +1. The time now is 05:05 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"