Time stamp cells on single mouse click

  • Hi everyone!


    Can someone help me on how I could get a time stamp on column G each time cells on column B is clicked?


    I tried inserting both commandbuttons or labels and set them to invisible so the text underneath is the thing to be seen. I got it to stamp the time on a single click alright however I would also want to be able to select the value on the cell underneath the label/button.


    [Blocked Image: http://www.mrexcel.com/forum/images/smilies/confused.gif]

  • Re: Time stamp cells on single mouse click


    I found this to work:


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim iRange As Range
    If Target.Cells.Count <> 1 Then Exit Sub
    Set iRange = Intersect(Target, Range("B:C"))
    If iRange Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Select Case Target.Column
    Case 2
    Range("G" & Target.Row).Value = Now()
    Columns("G:G").AutoFit
    Case 3
    Range("R" & Target.Row).Value = Now()
    Columns("R:R").AutoFit
    End Select
    Application.EnableEvents = True
    End Sub




    The only thing that's wrong with it is that the time stamp changes each time it is clicked again. How can I make so the original time doesnt change if for example I accidentally clicked on the cell again?

  • Re: Time stamp cells on single mouse click


    Hi mlegaspi,


    Please use [noparse]

    Code
    1. and

    [/noparse] tags around all code


    This should work:



    Thanks,
    Paul