+ Reply to Thread
Results 1 to 2 of 2

Mine Sweeper in Excel Solver

  1. #1
    Registered User
    Join Date
    09-21-2014
    Location
    England
    MS-Off Ver
    2007
    Posts
    1

    Mine Sweeper in Excel Solver

    Hello Trying to write a function that solve Minesweeper game in this file

    minesweeper.xlsm
    this is the code of the game
    Please Login or Register  to view this content.
    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
    Last edited by ponghki; 09-21-2014 at 04:25 AM.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Mine Sweeper in Excel Solver

    Welcome to the forum.

    Please take a minute to read the forum rules (at the forum rules link, above).
    You'll see that, while we don't prohibit posting the same question to more than one forum, we DO require that you include a link to the other post. We at Excel Forum all volunteer our valuable time to answer questions. Without the link, we would not know when your issue has been resolved so we can stop attempting to help you and spend that valuable time assisting others.

    Since this is your first post...I'll post the link for you...THIS time:
    http://www.mrexcel.com/forum/excel-q...el-solver.html
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 5
    Last Post: 09-29-2013, 06:46 PM
  2. Replies: 0
    Last Post: 12-16-2008, 11:21 PM
  3. how to tell excel about a delimiter of mine?
    By hgeek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2008, 11:30 AM
  4. [SOLVED] exporting excel to gold mine
    By Tony in forum Excel General
    Replies: 1
    Last Post: 05-12-2006, 08:50 AM
  5. How do I copy and paste Excel charts and retain formatting? Mine .
    By Ivan Lawler in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 02-18-2005, 10:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1