作者:乔山办公网日期:
返回目录:excel表格制作
1、首先,我们zhidao打开我们电脑上面的excel;
2、然后我版们在单机点击文件;
3、之后我们在单机点击新建;
4、然后我们在单机点击教育;
5、之后我们点击数独求解;
6、然后我们点击下载;
7、结果权如图所示,这样我们就制作好数独求解了。
度娘搜百索度下就OK啦知
提供个链道接给回你:答http://wenku.baidu.com/link?url=4J_DJ5jzsVobAE8QDG4vnGd7LPTDS7tRB_kZi2r_kpZkcFJtjlrm_lC7Od1LsOHo_Jmc-V95xbgoLcSrG9jrhgj1JOzEf0Eedf8MQyTB2dW
c1 填阶数,加一按钮,代码如下:
Private Sub CommandButton1_Click()
Application.EnableEvents = False
Dim N, i, j As Integer
Dim s As Long
N = CInt(Range("c2").Value)
'检查阶e799bee5baa6e78988e69d83336数
If N < 3 Or N > 253 Or N Mod 2 = 0 Then
MsgBox "请输入一 3至253 间的奇数。 ", 64, "设置幻方阶数"
Exit Sub
End If
'删除原为数据
Dim nRow As Integer
nRow = Range("d65536").End(xlUp).Row
nRow = IIf(nRow < 4, 4, nRow)
Rows("4:" & nRow).Delete
'生成幻方
i = 1
j = (N + 1) / 2 '第一个数在第一行的中间
For s = 1 To N ^ 2
Cells(i + 3, j + 3) = s
If Cells(IIf(i = 1, N, i - 1) + 3, IIf(j = 1, N, j - 1) + 3) = 0 Then
i = IIf(i = 1, N, i - 1)
j = IIf(j = 1, N, j - 1)
Else
i = IIf(i = N, 1, i + 1)
End If
Next
'单元格格式
With Range("d4", Cells(3 + N, 3 + N))
.ColumnWidth = 4
.RowHeight = 25
.Borders(xlEdgeLeft).LineStyle = xlDouble
.Borders(xlEdgeTop).LineStyle = xlDouble
.Borders(xlEdgeBottom).LineStyle = xlDouble
.Borders(xlEdgeRight).LineStyle = xlDouble
.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.HorizontalAlignment = xlCenter
.ShrinkToFit = True
End With
Application.EnableEvents = True
End Sub