PDA

View Full Version : Time Sheet Creation



SHYAM
11-06-2008, 07:02 AM
Hi,

How could I create an time sheet in excel with following features

1. User has to click on button (Start) - The current time should be automatically displayed in start time column
2. Agian when the user clicks on another button (Stop) - The current time should be automatically displayed in stop time column and aslo the difference between the start time and stop time needs to be calculated in total time taken column.

Regards,
Shyam

Bob Phillips
11-06-2008, 07:36 AM
.

SAhak
11-07-2008, 03:30 PM
Hi Shyam,

Try this

Assign ?EnterStartTime? macro to button ?Start?


Sub EnterStartTime()
Range("C65536").End(xlUp).Offset(1, 0) = Format(Now, "hh:MM")
End Sub

Assign ?EnterStopTime? macro to button ?Stop?


Sub EnterStopTime()
Range("D65536").End(xlUp).Offset(1, 0) = Format(Now, "hh:MM")
Range("D65536").End(xlUp).Offset(0, 1).Activate
ActiveCell.Value = Format(ActiveCell.Offset(0, -2).Value - ActiveCell.Offset(0, -1).Value, "hh:mm")
End Sub

To see difference between Stop & Start times in column E, you should push stop button after one minute minimum

Sahak