Right Click drop down or menu

Copper Contributor

How do I get the right click to work in Excel when entering data.  I am using Excel online. thank you.

2 Replies

@cathy_333 

 

With this VBA code you can display the current date with the right mouse button.

 

Option Explicit
Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel As Boolean)
'Me.Unprotect ("1234")
    If Not Intersect(Target, Range("A2:A10")) Is Nothing Then
        Target = IIf(Target = "", Date, "")
        Cancel = True
    End If

   ' Me.Protect ("1234")
End Sub

 

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.

sry
info for Excel Online

Excel online does not support VBA. Macros and custom functions will not run, and there is no way to make them run. VBA only runs in the desktop client, not online and not on Excel mobile.

Don't shoot the messenger.