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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,214,972
Messages
6,122,530
Members
449,088
Latest member
RandomExceller01

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