Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am starting to use macros in Excel and need help trying to find the visual
basic code (also new at vb) to capure time. I need to start time and finish time when wroking in Excel to time I sepend completing one form. JTS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You will need some sort of event to capture the start time and ending time.
I chose the Workbook Open event to capture the start time and BeforeSave event to capture the ending time. Place this code below in the ThisWorkbook Module. When you save the workbook a message box will appear telling you the time it took to fill the form out. Option Explicit Dim StartTime As Date Dim EndTime As Date Private Sub Workbook_Open() StartTime = Format(Now, "hh:mm:ss") End Sub Private Sub Workbook_BeforeSave() EndTime = Format(Now, "hh:mm:ss") MsgBox "Time Elasped = " & Format(EndTime - StartTime, "hh:mm:ss") End Sub Hope this helps! If so please click Yes below. -- Cheers, Ryan "JTS" wrote: I am starting to use macros in Excel and need help trying to find the visual basic code (also new at vb) to capure time. I need to start time and finish time when wroking in Excel to time I sepend completing one form. JTS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
Code for opening a workbook at a specific time!?! | Excel Discussion (Misc queries) | |||
UDF code to find specific text in cell comments, then average cell values | Excel Programming | |||
capturing a cell value at a specific time of day | Excel Programming |