ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   StopWatch Macros (https://www.excelbanter.com/excel-worksheet-functions/189351-stopwatch-macros.html)

ExcelMS

StopWatch Macros
 
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?


muddan madhu

StopWatch Macros
 
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



On May 30, 5:38*am, ExcelMS wrote:
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?



ExcelMS

StopWatch Macros
 
It works great, thank you so much for your help

"muddan madhu" wrote:

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



On May 30, 5:38 am, ExcelMS wrote:
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?





All times are GMT +1. The time now is 11:21 AM.

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