+ Reply to Thread
Results 1 to 5 of 5

Trigger macro on click

Hybrid View

  1. #1
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Trigger macro on click

    One way:

    Option Explicit
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        If Target.Cells.Count > 1 Then Exit Sub
        
        If Target.Row > 1 Then 'exclude header row
            If Target.Column = 2 Or Target.Column = 8 Then
                OpenCalendar
            End If
        End If
    
    End Sub
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  2. #2
    Forum Contributor
    Join Date
    11-25-2010
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2007
    Posts
    120

    Re: Trigger macro on click

    Quote Originally Posted by Palmetto View Post
    One way:

    Option Explicit
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        If Target.Cells.Count > 1 Then Exit Sub
        
        If Target.Row > 1 Then 'exclude header row
            If Target.Column = 2 Or Target.Column = 8 Then
                OpenCalendar
            End If
        End If
    
    End Sub
    Yes that line would be good housekeeping
    If the post was helpful please click the black star on the bottom left to add some reputation and mark your thread as SOLVED.

    A day with nothing new achieved or learned, albeit however small, is a day lost forever?

    Constant Never Ending Improvement

  3. #3
    Registered User
    Join Date
    06-30-2013
    Location
    Athens Greece
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Trigger macro on click

    THANKS a lot it worked fine!!

+ 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