StopWatch Macros

E

ExcelMS

I am trying to create two Macros linked with two Excel buttons from the forms
toolbar. I want the first button to be in cell B2 on Sheet 1 and say start.
I want the second button to be in cell J2 on Sheet 1 and say End.

I want the first button which is the start button, when it is clicked to
give me the exact time in cell D2 on Sheet 2. I want the second button which
is the end button, when it is clicked to give me the exact time in cell E2 on
Sheet 2. Do you have any ideas about how I might pull that off?
 
M

muddan madhu

Create two buttons in sheet1 using form, assign macro's respectively.


Sub Button1()
Sheets("sheet2").Select
Range("D2").Select
ActiveCell.FormulaR1C1 = time()
Sheets("sheet1").Select
ActiveSheet.Activate
End Sub


Sub button2()
Sheets("sheet2").Select
Range("E2").Select
ActiveCell.FormulaR1C1 = time()
Sheets("sheet1").Select
ActiveSheet.Activate
End Sub
 
E

ExcelMS

It works great, thank you so much for your help

muddan madhu said:
Create two buttons in sheet1 using form, assign macro's respectively.


Sub Button1()
Sheets("sheet2").Select
Range("D2").Select
ActiveCell.FormulaR1C1 = time()
Sheets("sheet1").Select
ActiveSheet.Activate
End Sub


Sub button2()
Sheets("sheet2").Select
Range("E2").Select
ActiveCell.FormulaR1C1 = time()
Sheets("sheet1").Select
ActiveSheet.Activate
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top