+ Reply to Thread
Results 1 to 6 of 6

assign double click event for multiple cells - easier way?

Hybrid View

  1. #1
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,938

    Re: assign double click event for multiple cells - easier way?

    Try...

    Dim CostC As String
        If Selection.Count = 1 Then
        
        'BEGIN Cost Center Assignments
            If Not Intersect(Target, Range("C4:C42")) Is Nothing Then
                CostC = Target.Value + "_S"
                ThisWorkbook.Sheets(CostC).Visible = True
                ThisWorkbook.Sheets(CostC).Activate
            End If
        End If
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,901

    Re: assign double click event for multiple cells - easier way?

    Another option:
    Place this macro in the code module for the "RevenueALL" sheet.
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Intersect(Target, Range("C4:C42")) Is Nothing Then Exit Sub
        Application.ScreenUpdating = False
        Sheets(Target.Value & "_S").Visible = True
        Sheets(Target.Value & "_S").Activate
        Application.ScreenUpdating = True
    End Sub
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

+ 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. double click event on range of cells
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2015, 08:27 AM
  2. [SOLVED] Before double click event with if statements (Double clicking blank cell stops bdc firing)
    By camdenpars in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-27-2014, 09:03 AM
  3. Click v double click event code
    By Greg J in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-09-2014, 04:08 AM
  4. [SOLVED] Double click event with multiple if statements
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-24-2014, 01:20 AM
  5. [SOLVED] Double Click Event to change and limit other cells
    By Bonnister in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2013, 05:03 AM
  6. Double click event
    By baz0912 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2008, 05:56 PM
  7. [SOLVED] userform label double-click goes to click event
    By John Paul Fullerton in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2006, 01:00 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