Thread: Hyperlink
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tim Williams[_4_] Tim Williams[_4_] is offline
external usenet poster
 
Posts: 114
Default Hyperlink


my bad:

Tim

Private Sub Worksheet_SelectionChange(ByVal Target As Range)


Const RNGS As String = "A2,A3,A4"
Dim x As Integer, arrRngs
Dim c As Range

arrRngs = Split(RNGS, ",")
'If you select A30
If Not Intersect(Target, Range("A30")) Is Nothing Then
For x = LBound(arrRngs) To UBound(arrRngs)
Me.Range(arrRngs(x)).Hyperlinks(1).Follow
Next x
End If


End Sub



On Dec 17, 2:09*pm, Doug wrote:
I am recieving a runtime error 438
Object doesn't support this property or method
--
Thank you!



"Tim Williams" wrote:
Try this.


Tim


Private Sub Worksheet_SelectionChange(ByVal Target As Range)


Const RNGS As String = "A2,A3,A4,A6,A7,A9,A10,A13,A14," & _
* * * * * * * * * * * *"A15,A20,A21,A24,A27,A28,A29"
Dim x As Integer, arrRngs


* * arrRngs = Split(RNGS, ",")
* * 'If you select A30
* * If Not Intersect(Target, Range("A30")) Is Nothing Then
* * * * For x = LBound(arrRngs) To UBound(arrRngs)
* * * * * * ActiveSheet.Range(arrRngs(x)).Hyperlink.Follow True
* * * * Next x
* * End If


End Sub- Hide quoted text -


- Show quoted text -