Results 1 to 3 of 3

Thread: Time Stamp on Mouse Click

  1. #1

    Post Time Stamp on Mouse Click



    Register for a FREE account, and/
    or Log in to avoid these ads!

    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".

    tnx n regards,
    mbvv

  2. #2
    Acolyte gsnidow's Avatar
    Join Date
    Aug 2011
    Location
    Virginia
    Posts
    38
    Articles
    0
    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

  3. #3
    Acolyte rollis13's Avatar
    Join Date
    Feb 2013
    Location
    Cordenons
    Posts
    31
    Articles
    0
    Excel Version
    2016 64bit
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •