PDA

View Full Version : Single & Double-Click a Shape Object



av8tordude
06-28-2020, 09:15 PM
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/threads/double-click-shape-objects.1138536/


Public LastClickObj As String, LastClickTime As Date
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 End Sub

Logit
06-29-2020, 05:28 PM
Disregard

SamT
06-29-2020, 08:19 PM
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