老婆的手机上有一个推箱子游戏,今天玩的时候突然感觉屏幕的图案有点象EXCEL的单元格啊。所以就以手机上的游戏为基础,写了一个在EXCEL里玩的推箱子游戏。
Private Sub
Workbook_BeforeClose(Cancel As Boolean)
Application.EditDirectlyInCell = True
End Sub
Private Sub
Workbook_Open()
Sheets("sheet1").ScrollArea = "D3:I8"
Application.EditDirectlyInCell = False
Call
base
End Sub
Public weizhi
As String
Sub
pailie()
Application.EnableEvents = False
Dim
tu$
Dim OperRg
As Range
Sheets("sheet1").Select
Set OperRg =
Sheets("sheet1").Range("D3:I8")
OperRg.Clear
OperRg.HorizontalAlignment = xlCenter
OperRg.VerticalAlignment = xlCenter
OperRg.Font.Name = "Wingdings"
OperRg.Font.Size = 28
tu =
Sheets("mission").Cells(Sheets("sheet1").Range("M6"), 1)
With
OperRg
For i = 1 To 36
If Mid(tu, i, 1) = "0" Then .Cells(i) = ""
If Mid(tu, i, 1) = "1" Then
.Cells(i) = "w"
.Cells(i).Interior.ColorIndex = 5
.Cells(i).Font.ColorIndex = 5
End If
If Mid(tu, i, 1) = "2" Then .Cells(i) = "O"
If Mid(tu, i, 1) = "3" Then .Cells(i) = "x"
If Mid(tu, i, 1) = "4" Then
.Cells(i) = "J"
weizhi = .Cells(i).Address
.Cells(i).Select
End If
Next i
If Len(tu) = 38 Then .Cells(CInt(Right(tu, 2))) = "O"
& .Cells(CInt(Right(tu, 2)))
If Len(tu) = 40 Then
.Cells(CInt(Mid(tu, 37, 2))) = "O" &
.Cells(CInt(Mid(tu, 37, 2)))