Could somebody look at this code?

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
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Forum statistics

Threads
1,213,487
Messages
6,113,943
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top