Date and time stamp, control button
I put a commandbutton from the control toolbox on a worksheet.
I added a worksheet called LogSheet to the workbook. I put headers in row 1.
Then I used this code under the commandbutton:
Option Explicit
Private Sub CommandButton1_Click()
Dim DestCell As Range
With Worksheets("LogSheet")
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With
With DestCell
.Value = Application.UserName
With .Offset(0, 1)
.Value = Now
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
End With
End Sub
I wasn't sure what else you want to keep track of, though. I just used the
username (from tools|Options|General tab) and the date/time.
MattB wrote:
I have a speardsheet I use to track sales calls. As of now it only tracks
totals by means of a control button that acts as a counter. (upon clicking
the button, it adds "1" to a cell for a total.) What I would like to do is
add to the control button so that each click is recorded seperately and date
and time stamped, preferably on a seperate sheet. any suggestions? (I'm not
the most educated on Visual Basics, I would be more than happy to e-mail what
I have now if that would be easier.)
--
Dave Peterson
|