Results 1 to 3 of 3

Navigate to sheet via VBA

Threaded View

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    42

    Navigate to sheet via VBA

    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
    Last edited by jeffreybrown; 09-29-2012 at 05:23 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1