#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default Macro

Hi,

I need time sheet macro.
Suppose one user starts his work @ 8 ,

Here is what I need ( Step by step)
1. before user starts working need to click the button, in just single
click on the button
time will be appeared in A10 cell. (e.g., 06:16:00 AM)

2. Once the user completes the work and then user click's the button
in B10 end time
will be showed (E.g., 06:20:00 AM)

3. Start and end time difference need to appear on A9 cell.

Can u please input solution.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 207
Default Macro


muddan madhu,
This is what I came up with for you to try:
Format the cells (A9, A10, &B10) with the Format, Cell, Time with the proper
format.
Put a Command button on the worksheet, Command1
Place a second Command button on the worksheet, Command2
On the worksheet select "Design Mode" icon.
Select the first button, right click, select "Properties"
On the "Alphabetic" tab, change the CAPTION entry from CommandButton1 to
"START". Change the PrintObject entry to "False" so the button will not print.

Select the first button again, right click, select "View Code"
Underneath the line "Private Sub CommandButton1_Click() type:

"Range("A10").Select
ActiveCell.FormulaR1C1 = Now()" without the ""

Select the second button, right click, select "Properties"
On the "Alphabetic" tab, change the CAPTION entry from CommandButton2 to
"END". Change the PrintObject entry to "False" so the button will not print.

Select the second button again, right click, select "View Code"
Underneath the line "Private Sub CommandButton2_Click() type:

"Range("B10").Select
ActiveCell.FormulaR1C1 = Now()


Range("A9").Select
ActiveCell.FormulaR1C1 = Range("B10") - Range("A10")
Range("A9").Select
ActiveCell.NumberFormat = "h:mm:ss""
Leaving off the first " and the last ".
hth

"muddan madhu" wrote:

Hi,

I need time sheet macro.
Suppose one user starts his work @ 8 ,

Here is what I need ( Step by step)
1. before user starts working need to click the button, in just single
click on the button
time will be appeared in A10 cell. (e.g., 06:16:00 AM)

2. Once the user completes the work and then user click's the button
in B10 end time
will be showed (E.g., 06:20:00 AM)

3. Start and end time difference need to appear on A9 cell.

Can u please input solution.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"