Hello,
I have this nifty little VBA code that changes the to an active chart when i select a cell.
However, i am trying to adapt it so that it will allow sheet selection too.
I.e. when i type inside the cell and click it it takes me to the chart (the worksheet has about 30+ charts), but i want it also to send me to a sheet when i select the cell, i did try adapting it but failed with the if/s?
Can anyone help?
--
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("I2")) Is Nothing Then
On Error Resume Next
Charts(Target.Value).Activate
If Err.Number <> 0 Then
MsgBox "No such chart exists.", vbCritical, _
"Chart Not Found"
End If
On Error GoTo 0
End If
End Sub
Moderator's Note: Please use code tags when displaying code. Forum Rule #3
Bookmarks