hartless43
New Member
- Joined
- Dec 28, 2022
- Messages
- 41
- Office Version
- 365
- Platform
- Windows
VBA Code:
Sub ClearRedFontsMistakes()
Dim rng As Range
Dim cell As Range
Dim redCount As Long
redCount = 0
Set rng = Range("B2:J10")
For Each cell In rng
If cell.DisplayFormat.Font.ColorIndex = 3 Then
redCount = redCount + 1
cell.ClearContents
End If
Next cell
Range("L10").Value = Range("L10").Value + redCount
End Sub
OK, all you experts, an armature needs some help.
The above Sub keeps track of Mistakes which will be any Red Font. When playing the Sudoku game any number entered that does not match up with the Solution it will turn Red. Then the Macro Erase Mistakes (the above code) will add the number of mistakes made to cell L10 and then remove the red Fonts. The last line in this sub keeps a running total of mistakes. This has been working fine and thanks to Fluff for part of the code. This has been working as designed, but now I have a little problem. Cell L10 no longer shows the number of Mistakes. I figured the color of the cell in L10 was changed, but it’s not, but when I click on the “empty” L10 I get the following. A number appears in the Formula Bar but not in L10 and when I hover my cursor over cell L10 a small box with rounded corners will appear and will have the same number as the Formula Bar. Just so happens this number is the remaining numbers to be played and if I do another mistake that number will double. I could not capture a picture of that box with the rounded corners, so does anyone know how it got there and how to get rid of it. I probably click on something in the task bar and cause this.
Thanks