Time Stamp on Mouse Click

maheshbvv

New member
Joined
Dec 6, 2013
Messages
1
Reaction score
0
Points
0
Hi Experts,

I wish to take a help from you for the things mentioned below,
I am looking for a VBA Code, which can help me to insert current time to the cell on click, and if there is already a value, it should prompt a message saying, "value present".
:pray::amen:
tnx n regards,
mbvv
 

gsnidow

New member
Joined
Aug 30, 2011
Messages
38
Reaction score
0
Points
0
Location
Virginia
mbvv, what have you tried so far? The answers you get may vary greatly from a few simple tips, to having to explain how to use VBE. The more info you provide, the more folks here will be willing to help.

Greg
 

rollis13

Member
Joined
Feb 22, 2013
Messages
82
Reaction score
0
Points
6
Location
Cordenons
Excel Version(s)
2016 32bit
Have a try with this code:
Code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Cells.Count <> 1 Then Exit Sub
    Application.EnableEvents = False
    If Target = "" Then
        Target.Value = Time()
        Target.Columns.AutoFit
    Else
        MsgBox "value present"
    End If
    Application.EnableEvents = True
End Sub
 
Top