Hello Trying to write a function that solve Minesweeper game in this file
minesweeper.xlsm
this is the code of the game
and here's my code but it can only generate a random cell
Function nextSafeCell() As Range
Dim RNG As Range
Set RNG = Range("b2:f6")
Dim randomCell As Long
randomCell = Int(Rnd * RNG.Cells.Count) + 1
set nextsafecell = RNG.Cells(randomCell)
End Function
Sub revealNextSafeCell()
Dim nextCell As Range
Set nextCell = nextSafeCell()
Range("A2").Select
nextCell.Select
End Sub
Big Thanks for helps
Bookmarks