Suraj John
New Member
Hey guys,
I created an Excel 2010 sheet that has a Start button that starts a timer and Stop and Reset button that stops and resets the timer respectively. But everytime I try to share the worksheet my button functionality for the Stop and Reset buttons is lost but for some reason my Start Button still remains active. I am posting the code below for you guys to have a look....Do kindly help out this confused noob
I created an Excel 2010 sheet that has a Start button that starts a timer and Stop and Reset button that stops and resets the timer respectively. But everytime I try to share the worksheet my button functionality for the Stop and Reset buttons is lost but for some reason my Start Button still remains active. I am posting the code below for you guys to have a look....Do kindly help out this confused noob
Code:
Dim maxrows As Long
Dim row, cols As Integer
Sub eventer()
Call addtime
Application.OnTime Now + TimeValue("00:00:01"), "Sheet1.eventer"
End Sub
Sub jukebox()
MsgBox "Face the music"
End Sub
Sub addtime()
maxrows = Sheet6.UsedRange.Rows.Count
For i = 2 To maxrows
row = Sheet6.Cells(i, 1).Value
cols = Sheet6.Cells(i, 2).Value
Sheet1.Cells(row, cols).Value = Sheet1.Cells(row, cols).Value + TimeValue("00:00:01")
Next
End Sub
Sub list()
Dim newss As Long
maxrows = Sheet6.UsedRange.Rows.Count
newss = maxrows + 1
Sheet6.Cells(newss, 1).Value = row
Sheet6.Cells(newss, 2).Value = cols
End Sub
Sub listdel()
maxrows = Sheet6.UsedRange.Rows.Count
For i = 1 To maxrows
If Sheet6.Cells(i, 1).Value = row And Sheet6.Cells(i, 2).Value = cols Then
Sheet6.Cells(i, 1).Delete shift:=xlUp
Sheet6.Cells(i, 2).Delete shift:=xlUp
Exit For
End If
Next
End Sub
Sub StartBtn_Click()
Selection.Interior.ColorIndex = 6
row = ActiveCell.row
cols = ActiveCell.Column
Selection.NumberFormat = "[h]:mm:ss;@"
ActiveCell.FormulaR1C1 = "12:00:00 AM"
Call list
End Sub
Sub Stop_Click()
Selection.Interior.ColorIndex = 4
row = ActiveCell.row
cols = ActiveCell.Column
Call listdel
End Sub
Sub Reset_Click()
Selection.Interior.ColorIndex = -4142
Selection.Value = "00:00:00"
Call listdel
End Sub