ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to create a time log sheet (https://www.excelbanter.com/excel-programming/397399-how-create-time-log-sheet.html)

Ram[_5_]

How to create a time log sheet
 
Hi,

I want to create a time log sheet. This sheet has name of team
members, and 2 buttons.. Login and log out. On clicking log in the
=now() function should be called. "This should not change each time we
open the sheet, once the sheet is saved that value should remain."

On clicking log out the =now() should be called which should not be
changed. and based on the log in and log out time the duration logged
in should come up.

Please help me design this.

Thanks!!


Bernie Deitrick

How to create a time log sheet
 
Ram,

For the buttons, assign macro code like this to the drawing objects (if you are using drawing
objects):

Sub CheckIn()
Cells(ActiveCell.Row, 2).Value = Time
End Sub

Sub CheckOut()
Cells(ActiveCell.Row, 3).Value = Time
End Sub

These will put the time into columns B (In) and C (Out) of the currently selected row.

If you are use a commandbutton from the controls toolbox, you would need to use the click events:

Private Sub CommandButton1_Click()
CheckIn
End Sub


Private Sub CommandButton2_Click()
CheckOut
End Sub

--
HTH,
Bernie
MS Excel MVP


"Ram" wrote in message
ups.com...
Hi,

I want to create a time log sheet. This sheet has name of team
members, and 2 buttons.. Login and log out. On clicking log in the
=now() function should be called. "This should not change each time we
open the sheet, once the sheet is saved that value should remain."

On clicking log out the =now() should be called which should not be
changed. and based on the log in and log out time the duration logged
in should come up.

Please help me design this.

Thanks!!





All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com