Colleen45
Active Member
- Joined
- Jul 22, 2007
- Messages
- 495
The code below works perfectly,
However when you click on a Hyperlink to go to another tab in the same workbook it throws up the error: "Item with specified name wasn't found."
The highlighted area for the code error is in the second part of the code .
How would we tell vba to ignore the error but go to the hyperlink anyway The hyperlink is in cell F372
However when you click on a Hyperlink to go to another tab in the same workbook it throws up the error: "Item with specified name wasn't found."
The highlighted area for the code error is in the second part of the code .
How would we tell vba to ignore the error but go to the hyperlink anyway The hyperlink is in cell F372
Code:
Option Explicit
Rem If cell = "yes" move cursor focus to selected cell
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub ' only one cell changes
If Not Intersect(Target, Range("E191,E197,E202,E212,F231,F233,F235,F251,F254,F260")) Is Nothing Then
If LCase(Target.Value) = "yes" Then
Select Case Target.Address(0, 0)
Case "E191": Range("G187").Select
Case "E197": Range("G193").Select
Case "E202": Range("G200").Select
Case "E212": Range("G205").Select
Case "F231": Range("I230").Select
Case "F233": Range("I232").Select
Case "F235": Range("I234").Select
Case "F251": Range("H247").Select
Case "F254": Range("H247").Select
Case "F260": Range("H257").Select
End Select
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveSheet.Shapes("Rectangle 1")
.Left = ActiveCell.MergeArea.Left
.Top = ActiveCell.MergeArea.Top
.Width = ActiveCell.MergeArea.Width
.Height = ActiveCell.MergeArea.Height
End With
End Sub