First, thank you for looking at my post! I have a simple macro in a worksheet that I use every day for keeping track of working on projects. It has worked since I wrote it without trouble, until I did the Office 2010 updates yesterday. Now it does not run at all. There were several updates that ran yesterday for Office 2010, I don't know which one at this point caused the problem. Is there anyway to find out without just uninstalling one at a time?
Any advice on what I should do? Change the macro, but I am not sure if I can get it back to working the way I would like. Below is the code. You can see there is not much too it. Just a quick macro to set the button to the correct state when it opens (bottom subroutine), and a macro to handle the toggle button click.
Thanks for any advice you can give.
Any advice on what I should do? Change the macro, but I am not sure if I can get it back to working the way I would like. Below is the code. You can see there is not much too it. Just a quick macro to set the button to the correct state when it opens (bottom subroutine), and a macro to handle the toggle button click.
Code:
Public ActivateWS
Private Sub ToggleButton1_Click()
If ActivateWS = False Then
If Me.ToggleButton1.Value = True Then
Me.ToggleButton1.Caption = "Clock Out"
Range("A7").Value = Date + Time
Range("A7").NumberFormat = "mm/dd/yyyy hh:mm AM/PM"
Else
Me.ToggleButton1.Caption = "Clock In"
Range("B7").Value = Date + Time
Range("B7").NumberFormat = "mm/dd/yyyy hh:mm AM/PM"
Range("C7").Formula = "=(B7-A7)*24"
Range("C7").NumberFormat = "0.00"
Rows("7:7").Insert Shift:=xlDown
With Range("A7:D7")
.Interior.ColorIndex = xlNone
.RowHeight = 12.75
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
End With
Range("B3").Formula = "=(B2-B1)/24+A7"
Range("D9").Copy 'Copy the previous sessions Notes.
Range("D8").Select
Paste
Range("A7").Activate
End If
End If
ActivateWS = False
End Sub
Private Sub Worksheet_Activate()
ActivateWS = True
If Range("A7").Value = "" Then
Me.ToggleButton1.Value = False
Me.ToggleButton1.Caption = "Clock In"
Else
Me.ToggleButton1.Value = True
Me.ToggleButton1.Caption = "Clock Out"
End If
End Sub
Thanks for any advice you can give.