Sub
auto()
Dim
x
As
Integer
If
Len(Sheet2.Range(
"f3"
)) <> 0
Then
MsgBox (
"先清除,后起新卦"
)
Exit
Sub
End
If
With
Sheet2
.Cells(4, 1).Value = Application.WorksheetFunction.RandBetween(0, 1)
.Cells(4, 2).Value = Application.WorksheetFunction.RandBetween(0, 1)
.Cells(4, 3).Value = Application.WorksheetFunction.RandBetween(0, 1)
.Cells(4, 4).Value = Application.WorksheetFunction.RandBetween(0, 1)
.Cells(4, 5).Value = Application.WorksheetFunction.RandBetween(0, 1)
.Cells(4, 6).Value = Application.WorksheetFunction.RandBetween(0, 1)
For
x = 1
To
6
If
.Cells(4, x).Value = 1
Then
.Cells(3, x) =
"O"
Else
.Cells(3, x) =
"X"
End
If
Next
End
With
End
Sub