![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
New Member
Join Date: Feb 2002
Location: Birmingham
Posts: 13
|
Try changing the offending line to
total = WorksheetFunction.Round(endtime - starttime, 0) |
|
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
Thanks
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|