Consulting

Results 1 to 3 of 3

Thread: Single & Double-Click a Shape Object

  1. #1

    Single & Double-Click a Shape Object

    I found this code that seems to allow me to achieve my objective, however, I can't seem to figure out how I can use this with a single click event also. I would like to be able to single click an Arrow Shape object and move it 1 row down and double click the Arrow Shape to move to the last used row.

    Xross post:
    https://www.mrexcel.com/board/thread...jects.1138536/

    Public LastClickObj AsString, LastClickTime AsDate
    Sub ShapeDoubleClick()
    Dim LRow As Long
    
    LRow = Range("A" & Rows.Count).End(xlUp).Row
    
    If LastClickObj = "" Then
        LastClickObj = Application.Caller
        LastClickTime = CDbl(Timer)
    Else
        If CDbl(Timer) - LastClickTime > 0.25 Then
            LastClickObj = Application.Caller
            LastClickTime = CDbl(Timer)
        Else
            If LastClickObj = Application.Caller Then
                MsgBox ("Double Click")
                Cells(Application.Max(7, ActiveCell.Row - 1), 1).Activate
                LastClickObj = ""
            Else
                LastClickObj = Application.Caller
                LastClickTime = CDbl(Timer)
            End If
        End If
    End If EndSub

  2. #2
    VBAX Mentor Logit's Avatar
    Joined
    Sep 2016
    Posts
    479
    Location
    Disregard

  3. #3
    Moderator VBAX Wizard SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,188
    Location
    Singleclick is SelectionChange or BeforeRightClick. Create a UserForm that resembles a RightClik Menu. Use BeforeRightClick to show the Form. Select an action from the Form
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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