When I received a booklet with Sudoku puzzles as a present, I couldn't help seeing an Excel spreadsheet... I started solving the puzzles using a pencil only, but after a few days I found it a bit boring, as there was no challenge left - it became routine.
And what do we do when a task becomes a routine? Write a macro to do it faster :-)
So, on a boring afternoon I wrote this macro that can solve all (at least all I have seen until now) Sudoku puzzles.
It first uses some logic to check all possible values for all cells. When there are still cells left with more than one possible number, it switches to a brute-force attack, simply trying all possible options until one works.
I created an interesting recursive routine that uses an extra sheet as a 'stack' to save intermediate solutions so that we can 'fall back' in case a chosen option didn't work out.
It's probably not the most elegant way to solve the puzzles, but it works! In fact, almost four years have passed and until now no problem has been found that my Sudoku solver could not resolve.
So here is my challenge... If you discover a Sudoku puzzle my solver cannot handle, I'll mention your submission on my page here! (and improve it so that it will...)
The VBA code of the macro is open for everyone to study (and copy if it pleases you...), as all software should be.

You can download Sudoku solver here.
You can get in touch with me from this page.













