Right Click drop down or menu

%3CLINGO-SUB%20id%3D%22lingo-sub-1701032%22%20slang%3D%22en-US%22%3ERight%20Click%20drop%20down%20or%20menu%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1701032%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20do%20I%20get%20the%20right%20click%20to%20work%20in%20Excel%20when%20entering%20data.%26nbsp%3B%20I%20am%20using%20Excel%20online.%20thank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1701032%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1702898%22%20slang%3D%22de-DE%22%3ESubject%3A%20Right%20Click%20drop%20down%20or%20menu%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1702898%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F805291%22%20target%3D%22_blank%22%3E%40cathy_333%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EWith%20this%20VBA%20code%20you%20can%20display%20the%20current%20date%20with%20the%20right%20mouse%20button.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EOption%20Explicit%0APrivate%20Sub%20Worksheet_BeforeRightClick(ByVal%20Target%20As%20Excel.Range%2C%20Cancel%20As%20Boolean)%0A'Me.Unprotect%20(%221234%22)%0A%20%20%20%20If%20Not%20Intersect(Target%2C%20Range(%22A2%3AA10%22))%20Is%20Nothing%20Then%0A%20%20%20%20%20%20%20%20Target%20%3D%20IIf(Target%20%3D%20%22%22%2C%20Date%2C%20%22%22)%0A%20%20%20%20%20%20%20%20Cancel%20%3D%20True%0A%20%20%20%20End%20If%0A%0A%20%20%20'%20Me.Protect%20(%221234%22)%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E*%20Kindly%20Mark%20and%20Vote%20this%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20community%20members%20reading%20here.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

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.