-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExcel-Sudoku-Master-Solver_V2_Module(1)-Code.vb
65 lines (44 loc) · 1.21 KB
/
Excel-Sudoku-Master-Solver_V2_Module(1)-Code.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Option Explicit
'Global Variables
Public FAIL As Boolean
Public genMsg As Integer
Public valMsg As Boolean
'Main Function
Public Function runSolve()
FAIL = False
''''''''''''''''''''''''
'''Ensure valid Board'''
''''''''''''''''''''''''
'doesnt show valid message
valMsg = False
Call ensureValid
''''''''''''''''''''''''
''''find solution'''''''
''''''''''''''''''''''''
If (FAIL <> True) Then
Call solvePuzzle
End If
'''''''''''''''''''''''''
End Function
'Clears Spreadsheet
Public Function clearSheet()
Dim x As Integer
Dim y As Integer
x = 1
Do While (x <= 9)
y = 2
Do While (y <= 10)
With Cells(y, x)
.Value = ""
.Font.Name = "Georgia"
.Font.Size = 36
.Font.Bold = True
.Font.Color = RGB(52, 131, 202)
.Interior.Color = RGB(234, 220, 244)
.VerticalAlignment = xlVAlignBottom
End With
y = y + 1
Loop
x = x + 1
Loop
End Function