G
Guest
Guest
I downloaded a workbook with this code but when I open it it crashes at the point in bold, I think it might have been for Excel 2000, can any one "fix it for '97? Thanks
Sub Check_Complete()
Dim cell As Range
Dim ans As String
On Error GoTo Incorrect
For Each cell In Range("c3:n14")
If cell.Value <> Sheet2.Range(cell.Address) Then GoTo Incorrect
Next cell
Dim endtime
Dim total
endtime = Timer
total = Round(endtime - starttime, 0)
hours = WorksheetFunction.RoundDown(total / 3600, 0)
minutes = WorksheetFunction.RoundDown(((total - (hours * 3600)) / 60), 0)
seconds = WorksheetFunction.RoundDown(total - (minutes * 60) - (hours * 3600), 0)
ans = MsgBox _
("Congratulations! You are VERY SMART! It only took you: " & Chr(13) & Chr(13) & _
" " & hours & " hours, " & minutes & " minutes, " & _
seconds & " seconds" & Chr(13) & Chr(13) & _
" " & "Would you like to print your results?", _
vbYesNo, "HOORAY!!")
If ans = vbYes Then Call Report
Incorrect:
End Sub
Sub Check_Complete()
Dim cell As Range
Dim ans As String
On Error GoTo Incorrect
For Each cell In Range("c3:n14")
If cell.Value <> Sheet2.Range(cell.Address) Then GoTo Incorrect
Next cell
Dim endtime
Dim total
endtime = Timer
total = Round(endtime - starttime, 0)
hours = WorksheetFunction.RoundDown(total / 3600, 0)
minutes = WorksheetFunction.RoundDown(((total - (hours * 3600)) / 60), 0)
seconds = WorksheetFunction.RoundDown(total - (minutes * 60) - (hours * 3600), 0)
ans = MsgBox _
("Congratulations! You are VERY SMART! It only took you: " & Chr(13) & Chr(13) & _
" " & hours & " hours, " & minutes & " minutes, " & _
seconds & " seconds" & Chr(13) & Chr(13) & _
" " & "Would you like to print your results?", _
vbYesNo, "HOORAY!!")
If ans = vbYes Then Call Report
Incorrect:
End Sub