i creating work sheet in excel want track start , end time of particular transaction using timestamp. column show time duration. please see picture below. can me?
i found 2 vba codes records time stamps. however, don't know how merge them work in sheet:
code 1 . shows timestamp in "start time" column (b4) when enter transaction number in "case id" coumn (a4).
private sub worksheet_change(byval target range)
on error goto handler
if target.column = 1 , target.value <> "" then
application.enableevents = false
target.offset(0, 1) = format(now(), "mm/dd/yyyy hh:mm:ss")
application.enableevents = true
end if
handler:
end sub
code 2. shows time stamp in "end time" column (d4) if selection dropdown in "status" column (c4) selected.
private sub worksheet_change(byval target range)
dim xcellcolumn integer
dim xtimecolumn integer
dim xrow, xcol integer
xcellcolumn = 3
xtimecolumn = 4
xrow = target.row
xcol = target.column
if target.text <> "" then
if xcol = xcellcolumn then
cells(xrow, xtimecolumn) = now()
end if
end if
end sub
if triggering start/stop time manually, here couple more techniques can try:
https://excelchamps.com/blog/timestamp/
Office / Excel / Windows 10 / Office 2016
Comments
Post a Comment