Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to name sheet tabs | Excel Discussion (Misc queries) | |||
Excel Unhides Rows | Excel Discussion (Misc queries) | |||
Excel unhides rows | Excel Discussion (Misc queries) | |||
excel unhides rows | Excel Discussion (Misc queries) | |||
is there anyway in an excel macro to reorder the sheet tabs from left to right? | Excel Worksheet Functions |