+ Reply to Thread
Results 1 to 5 of 5

Worksheet_BeforeDoubleClick - multiple cells, multiple sheet activations

  1. #1
    Registered User
    Join Date
    11-19-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Worksheet_BeforeDoubleClick - multiple cells, multiple sheet activations

    Hello,

    I am looking to be able to double click on a cell to activate opening another sheet (in the same workbook).

    So far I have this code

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Intersect(Target, Range("B4")) Is Nothing Then
    Else
    Sheet2.Activate
    End If
    End Sub


    Which works fine for double clicking on Cell B4, then opens Sheet 2.

    How do i add multiple conditions to this in the same Sub so I can open more sheets?

    i.e. double clicking
    B4 = Sheet2.Activate
    B5 = Sheet3.Activate
    B6 = Sheet4.Activate
    B7 = Sheet5.Activate

    and so on..

    Any help would be greatly appreciated I am struggling to figure this one out.
    Thanks

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Worksheet_BeforeDoubleClick - multiple cells, multiple sheet activations

    Danny

    Will you be double clicking the same sheet every time?

    What's in the cells you are double clicking?

    Please Login or Register  to view this content.
    Last edited by Norie; 11-19-2013 at 04:19 PM.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-19-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Worksheet_BeforeDoubleClick - multiple cells, multiple sheet activations

    Yes, double clicking from the same sheet.
    It's just text that's in the cells I wish to double click on.
    The premise is that a person will go onto Sheet1, find their name and double click on it to take them to their designated tab.

  4. #4
    Registered User
    Join Date
    11-19-2013
    Location
    Scotland
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Worksheet_BeforeDoubleClick - multiple cells, multiple sheet activations

    Thanks for the above code Norie.

    This works, but only if the sheets are all unhidden.

    Is there a way for it to search for and unhide the correct sheet?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Try adding this before the activate line at the end of the code.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need Help with Multiple Message Box Activations
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2013, 09:56 PM
  2. [SOLVED] Worksheet_BeforeDoubleClick with sheet protection works every other time
    By Jovica in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-05-2013, 05:01 AM
  3. Copying multiple cells from multiple worksheets to one summary sheet
    By Dragothemensch in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2013, 08:39 PM
  4. pasting the content of multiple cells into multiple cells on another sheet
    By cubinity in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2011, 09:33 PM
  5. [SOLVED] Create multiple sheet tabs from multiple cells.
    By Robert Maddox in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-19-2006, 05:40 PM

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