dj44
12-29-2016, 11:10 AM
Hi folks,:)
Good Thursday,
I am trying to unhide worksheets listed in column B
The below should work but I can't spot the typo or error.
The name of the Worksheet is listed in Column B, when the cell is clicked it should unhide the worksheet
Example Click B2 that has the name of the worksheet 1, click B3 Unhide TestWS
B2 ---- > Worksheet 1
B3 ----- > TestWS
B4 ------ > Data
etc
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim oWs As Worksheet
On Error Resume Next
If Not Intersect(ActiveCell, Range("B2:B6")) Is Nothing Then
oWs.Name = ActiveCell.Text
oWs.Visible = xlSheetVisible
End If
End Sub
thank you
Good Thursday,
I am trying to unhide worksheets listed in column B
The below should work but I can't spot the typo or error.
The name of the Worksheet is listed in Column B, when the cell is clicked it should unhide the worksheet
Example Click B2 that has the name of the worksheet 1, click B3 Unhide TestWS
B2 ---- > Worksheet 1
B3 ----- > TestWS
B4 ------ > Data
etc
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Dim oWs As Worksheet
On Error Resume Next
If Not Intersect(ActiveCell, Range("B2:B6")) Is Nothing Then
oWs.Name = ActiveCell.Text
oWs.Visible = xlSheetVisible
End If
End Sub
thank you