Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Macro that unhides sheet tabs

Hi from Sunny RSA,

Looking for a macro that once a cell is selected (D5) then a tab called the
same as cell D5 unhides itself.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro that unhides sheet tabs

Right click sheet tabview codecopy/paste this. If sheet2 is hidden and
sheet2 is typed into the cell and you then select that cell sheet2 will be
visible

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Sheets(CStr(Target)).Visible = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Sunnyskies" wrote in message
...
Hi from Sunny RSA,

Looking for a macro that once a cell is selected (D5) then a tab called
the
same as cell D5 unhides itself.

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default Macro that unhides sheet tabs

Surely you don't want this to work on just one cell (D5). I'll assume you
want this to work on D5:F10. The following macro will do what you want
whenever any cell in the range D5:F10 is selected. Note that this macro
must be placed in the sheet module of the sheet that holds the D5:F10 sheet
names. To access that module, right-click on the sheet tab, select View
Code, and paste this macro into that module. "X" out of the module to
return to your sheet. HTH Otto
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("D5:F10")) Is Nothing Then
Sheets(Target.Value).Visible = True
End If
End Sub
"Sunnyskies" wrote in message
...
Hi from Sunny RSA,

Looking for a macro that once a cell is selected (D5) then a tab called
the
same as cell D5 unhides itself.

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro that unhides sheet tabs

Maybe this

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Target.Address = "$D$5" Then
On Error Resume Next
Application.EnableEvents = False
Sheets(Target.Text).Visible = True
Application.EnableEvents = True
On Error GoTo 0
End If
End Sub

Mike

"Sunnyskies" wrote:

Hi from Sunny RSA,

Looking for a macro that once a cell is selected (D5) then a tab called the
same as cell D5 unhides itself.

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Macro that unhides sheet tabs

Hi,
Try this, entered onto the VBA sheet window - the same sheet as the D5
thingy is on.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Target.Address = Range("D5").Address Then
Sheets(Range("D5").Value).Visible = True
End If
End Sub

Regards - Dave.
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
Macro to name sheet tabs Bill_S Excel Discussion (Misc queries) 4 April 10th 08 03:45 PM
Excel Unhides Rows Gingit Excel Discussion (Misc queries) 5 December 1st 06 10:27 PM
Excel unhides rows Gingit Excel Discussion (Misc queries) 0 November 9th 06 06:56 PM
excel unhides rows Elliot Excel Discussion (Misc queries) 2 August 11th 06 09:30 PM
is there anyway in an excel macro to reorder the sheet tabs from left to right? Daniel Excel Worksheet Functions 2 June 23rd 05 07:34 PM


All times are GMT +1. The time now is 12:38 PM.

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"