Selected Answer
Please install this code in the code sheet of the worksheet on which you want the action. Note that the font color will be set, and a random selection made, when the sheet is activated. Change to another worksheet and back to see this action. After that the code does what you describe.
Option Explicit
Const RangeAddress As String = "C2:J5"
Private Sub Worksheet_Activate()
ShowRandomCell
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Rng As Range
Dim CellId As Long
Set Rng = Range(RangeAddress)
If Not Application.Intersect(Target, Rng) Is Nothing Then
If Target.Font.Color = vbBlack Then ShowRandomCell
End If
End Sub
Private Sub ShowRandomCell()
Static PreviousId As Long
Dim Rng As Range
Dim CellId As Long
Set Rng = Range(RangeAddress)
Rng.Font.Color = vbWhite
Do
Randomize
CellId = Int(Rnd * Rng.Cells.Count) + 1
Loop While CellId = PreviousId
With Rng.Cells(CellId)
.Font.Color = vbBlack
End With
PreviousId = CellId
End Sub
You can change the constant 'RangeAddress' to match your needs.