close

456  

 

Private Sub CommandButton1_Click()
For i = 1 To 9
Cells(1, i) = i
Cells(2, i) = i

Cells(1, i).Font.ColorIndex = 0
Next
Cells(3, 1) = Fix(Rnd() * 9 + 1)
Switch
Cells(1, Cells(3, 1)).Font.ColorIndex = 4
For j = 1 To 9
Cells(3, 1) = Fix(Rnd() * j + 1)
t = Cells(1, Cells(3, 1))
Cells(1, Cells(3, 1)) = Cells(1, j)
Cells(1, j) = t
Next
End Sub

 

 

 

未命名  

 

 

 

 

Private Sub CommandButton1_Click()
For i = 1 To 9
Cells(1, i) = i
Cells(1, i).Font.ColorIndex = 0
Next
Cells(3, 1) = Fix(Rnd() * 9 + 1)

Switch
For j = 1 To 9
i = 10 - j
Cells(3, 1) = Fix(Rnd() * i + 1)
a = Cells(1, Cells(3, 1))
Cells(1, Cells(3, 1)) = Cells(1, i)
Cells(1, i) = a
Next
End Sub

 

arrow
arrow
    全站熱搜

    open7412 發表在 痞客邦 留言(0) 人氣()