D
DonJ_Austin
I have had the following code working for some time. I am now adding a
hyperlink in a cell on the same sheet, but OUTSIDE the Named Range
"EntryCells". When I click on the link, I get an error msg "Method
'Intersect' of object '_Global' failed" and the debugger takes me to the "Set
iSect ..." line in the routine below.
Since I am clicking on a cell with no intersection inside the specified
range, I do not understand why I am not falling through the code with iSect =
Nothing. I can click on any *other* cell (without a link) outside that range
and nothing happens (which is correct).
I have found that if I 'long click' on the link and then separately click
(regularly) on it, the link is taken without the code problem. This makes no
sense and I cannot expect the users to understand or remember that.
Is there some mysterious connection between Intersect and hyperlinks on a
given worksheet ?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim iSect As Range
If Target.Cells.Count = 1 Then
Set iSect = Intersect(ActiveCell, Range("EntryCells"))
If iSect Is Nothing Then
Range("EntryPromptDisplay") = ""
Exit Sub
Else
Sheets("WorkData").Range("EntryPromptLookup") = Cells(Target.Row, 5)
Range("EntryPromptDisplay") =
Sheets("WorkData").Range("EntryPromptLookup").Offset(0, 1)
End If
End If
Set iSect = Nothing
End Sub
Thank you for any help.
hyperlink in a cell on the same sheet, but OUTSIDE the Named Range
"EntryCells". When I click on the link, I get an error msg "Method
'Intersect' of object '_Global' failed" and the debugger takes me to the "Set
iSect ..." line in the routine below.
Since I am clicking on a cell with no intersection inside the specified
range, I do not understand why I am not falling through the code with iSect =
Nothing. I can click on any *other* cell (without a link) outside that range
and nothing happens (which is correct).
I have found that if I 'long click' on the link and then separately click
(regularly) on it, the link is taken without the code problem. This makes no
sense and I cannot expect the users to understand or remember that.
Is there some mysterious connection between Intersect and hyperlinks on a
given worksheet ?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim iSect As Range
If Target.Cells.Count = 1 Then
Set iSect = Intersect(ActiveCell, Range("EntryCells"))
If iSect Is Nothing Then
Range("EntryPromptDisplay") = ""
Exit Sub
Else
Sheets("WorkData").Range("EntryPromptLookup") = Cells(Target.Row, 5)
Range("EntryPromptDisplay") =
Sheets("WorkData").Range("EntryPromptLookup").Offset(0, 1)
End If
End If
Set iSect = Nothing
End Sub
Thank you for any help.