auto entry or date and time when you tab into the cell

%3CLINGO-SUB%20id%3D%22lingo-sub-1671280%22%20slang%3D%22en-US%22%3Eauto%20entry%20or%20date%20and%20time%20when%20you%20tab%20into%20the%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1671280%22%20slang%3D%22en-US%22%3E%3CP%3Eplease%20assist%20I%20am%20tryin%20to%20auto%20enter%20date%20and%20time%20in%20a%20cell%20when%20you%20tab%20into%20the%20cell%20can%20any%20one%20assist%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1671280%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1672006%22%20slang%3D%22de-DE%22%3ESubject%3A%20auto%20entry%20or%20date%20and%20time%20when%20you%20tab%20into%20the%20cell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1672006%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F795003%22%20target%3D%22_blank%22%3E%40alebeouf%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%3EI%20don't%20know%20what%20exactly%20you%20want%20because%20they%20didn't%20have%20a%20file%20attached.%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22%22%3EIt%20would%20be%20an%20advantage%20if%20a%20file%20(without%20sensitive%20data)%20were%20included%2C%20so%20you%20could%20come%20to%20a%20solution%20more%20quickly.%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EAnyway%2C%20here%20is%20a%20solution%20with%20VBA%20where%20you%20can%20adjust%20the%20range%20and%20let%20the%20date%20appear%20automatically%20with%20the%20right%20mouse%20button.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EOption%20Explicit%0A%0APrivate%20Sub%20Worksheet_BeforeRightClick(ByVal%20Target%20As%20Excel.Range%2C%20Cancel%20As%20Boolean)%0AMe.Unprotect%20(%221234%22)%0A%20%20%20%0A%20%20%20%20%20If%20Not%20Intersect(Target%2C%20Range(%22A10%3AB1009%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%20%20%20%20%20%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
Highlighted
New Contributor

please assist I am tryin to auto enter date and time in a cell when you tab into the cell can any one assist

1 Reply
Highlighted

@alebeouf 

 

I don't know what exactly you want because they didn't have a file attached. It would be an advantage if a file (without sensitive data) were included, so you could come to a solution more quickly.

Anyway, here is a solution with VBA where you can adjust the range and let the date appear automatically 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("A10:B1009")) 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.