Has anyone discovered a way to suspend a running macro to allow input to a cell on the active worksheet? Upon entry control would be returned to the macro for manipulation of the entered value.
While not a macro per se the worksheet_change event works for me. This has been more than a simple math trainer for my grandson but a journey of discovery for me. Thank you all for your help. The basic code that I can build upon follows...
Oh! In my zeal to get an answer I mistakenly cross posted to another forum without proper notice. (rtfms). I bear the cross of my 5 demerit points with suitable shame. Thanks again all.![]()
Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False Answer = Range("G22").Value Range("G22").Select If Answer <> "" Then If Answer = MyTotal Then Range("G18").Value = "GREAT JOB" Else Range("G18").Value = "SORRY, TRY AGAIN" Application.EnableEvents = True Exit Sub End If End If MyTotal = 0 For Each c In Worksheets("Sheet1").Range("G20:G21") MyValue = Int((15 * Rnd) + 1) ' Generate random values between 1 and 15 c.Value = MyValue MyTotal = MyTotal + MyValue Next c Worksheets("Sheet1").Range("G22").ClearContents Application.EnableEvents = True End Sub











LinkBack URL
About LinkBacks
Register To Reply

more clutter on my spreadsheet
As far as I can tell MsgBox uses canned responses and does not allow entry of the value that I would otherwise enter on the spreadsheet. I was hoping to find a subtler solution. I really appreciate you taking the time to respond to my post. Thanks

Bookmarks