+ Reply to Thread
Results 1 to 2 of 2

Run macro on double click - several macros on one worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Run macro on double click - several macros on one worksheet

    Hi, I am fairly new at this so would appreciate any advice!

    I have several macros written that open other workbooks. I have a "front page" worksheet with a list of these workbooks. I would like to be able to double click the name of the workbook and have it run the macro to open it.

    I have gone into the code for this worksheet and have a private sub before double click. I then used "case" to state that if a certain cell was doubled clicked, then call the macro to open that workbook:

    
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        Select Case Target.AddressLocal(False, False)
    
        Case "G9"
            Call Blends
            Cancel = True
    
        Case "G11"
            Call Data
                Cancel = True
    
        Case "G13"
            Call Manufacture
            Cancel = True
        
        End Select
    End Sub
    My workbook open macros are working but the double click procedure isn't. Can anyone shed any light on why please? Or help me find a better way to do it?

    Thank you in advance.

  2. #2
    Registered User
    Join Date
    01-21-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Run macro on double click - several macros on one worksheet

    It's ok, I solved it!

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Target.Row = 9 Then
            Call Blends
            ElseIf Target.Row = 11 Then
            Call Data
            End If
            
    End Sub

+ Reply to Thread

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