Thread
:
Sheet Select Macro
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Sheet Select Macro
Try
If Not Intersect(Target, Range("B3:B52,j3:j52")) Is Nothing Then
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"santaviga" wrote in message
...
I have the folowing macro that works on one of my excel workbooks.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ws As Worksheet
If Not Intersect(Target, Range("B3:B52")) Is Nothing Then
On Error Resume Next
Set ws = Worksheets(Target.Row)
If ws Is Nothing Then
MsgBox "Sorry, but there is no worksheet named " & Target.Row
Else
ws.Activate
End If
End If
End Sub
This selects the sheet that corresponds to the cell. but I have cells in
J3:J52 as well but cant select the sheets that correspond to those can
anyone
help?
Regards
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett