I am trying to implement the game 2048 in Excel VBA.

The each TRUE / FALSE Boolean value in row 2, 4, 6 and 8 are used for determining the data of each cell in row 1, 3, 5 and 7 is 0 or not.
The experimental implementation
Sub MergeUp()
Dim loop_num
Dim loop_num2
For loop_num2 = 1 To 3
For loop_num = 1 To 4
If Cells(6, loop_num) = True Then
Cells(5, loop_num) = Cells(7, loop_num)
Cells(7, loop_num) = 0
End If
If Cells(4, loop_num) = True Then
Cells(3, loop_num) = Cells(5, loop_num)
Cells(5, loop_num) = 0
End If
If Cells(2, loop_num) = True Then
Cells(1, loop_num) = Cells(3, loop_num)
Cells(3, loop_num) = 0
End If
Next
Next
For loop_num = 1 To 4
If Cells(1, loop_num) = Cells(3, loop_num) Then
Cells(1, loop_num) = Cells(1, loop_num) + Cells(3, loop_num)
Cells(9, "C") = Cells(9, "C") + Cells(3, loop_num)
Cells(3, loop_num) = 0
End If
If Cells(3, loop_num) = Cells(5, loop_num) Then
Cells(3, loop_num) = Cells(3, loop_num) + Cells(5, loop_num)
Cells(9, "C") = Cells(9, "C") + Cells(5, loop_num)
Cells(5, loop_num) = 0
End If
If Cells(5, loop_num) = Cells(7, loop_num) Then
Cells(5, loop_num) = Cells(5, loop_num) + Cells(7, loop_num)
Cells(9, "C") = Cells(9, "C") + Cells(7, loop_num)
Cells(7, loop_num) = 0
End If
Next
For loop_num2 = 1 To 3
For loop_num = 1 To 4
If Cells(6, loop_num) = True Then
Cells(5, loop_num) = Cells(7, loop_num)
Cells(7, loop_num) = 0
End If
If Cells(4, loop_num) = True Then
Cells(3, loop_num) = Cells(5, loop_num)
Cells(5, loop_num) = 0
End If
If Cells(2, loop_num) = True Then
Cells(1, loop_num) = Cells(3, loop_num)
Cells(3, loop_num) = 0
End If
Next
Next
Call rand_num
End Sub
Sub MergeDown()
Dim loop_num
Dim loop_num2
For loop_num2 = 1 To 3
For loop_num = 1 To 4
If Cells(4, loop_num) = True Then
Cells(3, loop_num) = Cells(1, loop_num)
Cells(1, loop_num) = 0
End If
If Cells(6, loop_num) = True Then
Cells(5, loop_num) = Cells(3, loop_num)
Cells(3, loop_num) = 0
End If
If Cells(8, loop_num) = True Then
Cells(7, loop_num) = Cells(5, loop_num)
Cells(5, loop_num) = 0
End If
Next
Next
For loop_num = 1 To 4
If Cells(7, loop_num) = Cells(5, loop_num) Then
Cells(7, loop_num) = Cells(7, loop_num) + Cells(5, loop_num)
Cells(9, "C") = Cells(9, "C") + Cells(5, loop_num)
Cells(5, loop_num) = 0
End If
If Cells(5, loop_num) = Cells(3, loop_num) Then
Cells(5, loop_num) = Cells(5, loop_num) + Cells(3, loop_num)
Cells(9, "C") = Cells(9, "C") + Cells(3, loop_num)
Cells(3, loop_num) = 0
End If
If Cells(3, loop_num) = Cells(1, loop_num) Then
Cells(3, loop_num) = Cells(3, loop_num) + Cells(1, loop_num)
Cells(9, "C") = Cells(9, "C") + Cells(1, loop_num)
Cells(1, loop_num) = 0
End If
Next
For loop_num2 = 1 To 3
For loop_num = 1 To 4
If Cells(4, loop_num) = True Then
Cells(3, loop_num) = Cells(1, loop_num)
Cells(1, loop_num) = 0
End If
If Cells(6, loop_num) = True Then
Cells(5, loop_num) = Cells(3, loop_num)
Cells(3, loop_num) = 0
End If
If Cells(8, loop_num) = True Then
Cells(7, loop_num) = Cells(5, loop_num)
Cells(5, loop_num) = 0
End If
Next
Next
Call rand_num
End Sub
Sub MergeLeft()
For loop_num2 = 1 To 3
For loop_num = 1 To 7 Step 2
If Cells(loop_num + 1, "C") = True Then
Cells(loop_num, "C") = Cells(loop_num, "D")
Cells(loop_num, "D") = 0
End If
If Cells(loop_num + 1, "B") = True Then
Cells(loop_num, "B") = Cells(loop_num, "C")
Cells(loop_num, "C") = 0
End If
If Cells(loop_num + 1, "A") = True Then
Cells(loop_num, "A") = Cells(loop_num, "B")
Cells(loop_num, "B") = 0
End If
Next
Next
For loop_num = 1 To 7 Step 2
If Cells(loop_num, "A") = Cells(loop_num, "B") Then
Cells(loop_num, "A") = Cells(loop_num, "A") + Cells(loop_num, "B")
Cells(9, "C") = Cells(9, "C") + Cells(loop_num, "B")
Cells(loop_num, "B") = 0
End If
If Cells(loop_num, "B") = Cells(loop_num, "C") Then
Cells(loop_num, "B") = Cells(loop_num, "B") + Cells(loop_num, "C")
Cells(9, "C") = Cells(9, "C") + Cells(loop_num, "C")
Cells(loop_num, "C") = 0
End If
If Cells(loop_num, "C") = Cells(loop_num, "D") Then
Cells(loop_num, "C") = Cells(loop_num, "C") + Cells(loop_num, "D")
Cells(9, "C") = Cells(9, "C") + Cells(loop_num, "D")
Cells(loop_num, "D") = 0
End If
Next
For loop_num2 = 1 To 3
For loop_num = 1 To 7 Step 2
If Cells(loop_num + 1, "C") = True Then
Cells(loop_num, "C") = Cells(loop_num, "D")
Cells(loop_num, "D") = 0
End If
If Cells(loop_num + 1, "B") = True Then
Cells(loop_num, "B") = Cells(loop_num, "C")
Cells(loop_num, "C") = 0
End If
If Cells(loop_num + 1, "A") = True Then
Cells(loop_num, "A") = Cells(loop_num, "B")
Cells(loop_num, "B") = 0
End If
Next
Next
Call rand_num
End Sub
Sub MergeRight()
For loop_num2 = 1 To 3
For loop_num = 1 To 7 Step 2
If Cells(loop_num + 1, "B") = True Then
Cells(loop_num, "B") = Cells(loop_num, "A")
Cells(loop_num, "A") = 0
End If
If Cells(loop_num + 1, "C") = True Then
Cells(loop_num, "C") = Cells(loop_num, "B")
Cells(loop_num, "B") = 0
End If
If Cells(loop_num + 1, "D") = True Then
Cells(loop_num, "D") = Cells(loop_num, "C")
Cells(loop_num, "C") = 0
End If
Next
Next
For loop_num = 1 To 7 Step 2
If Cells(loop_num, "C") = Cells(loop_num, "D") Then
Cells(loop_num, "D") = Cells(loop_num, "D") + Cells(loop_num, "C")
Cells(9, "C") = Cells(9, "C") + Cells(loop_num, "C")
Cells(loop_num, "C") = 0
End If
If Cells(loop_num, "B") = Cells(loop_num, "C") Then
Cells(loop_num, "C") = Cells(loop_num, "C") + Cells(loop_num, "B")
Cells(9, "C") = Cells(9, "C") + Cells(loop_num, "B")
Cells(loop_num, "B") = 0
End If
If Cells(loop_num, "A") = Cells(loop_num, "B") Then
Cells(loop_num, "B") = Cells(loop_num, "B") + Cells(loop_num, "A")
Cells(9, "C") = Cells(9, "C") + Cells(loop_num, "A")
Cells(loop_num, "A") = 0
End If
Next
For loop_num2 = 1 To 3
For loop_num = 1 To 7 Step 2
If Cells(loop_num + 1, "B") = True Then
Cells(loop_num, "B") = Cells(loop_num, "A")
Cells(loop_num, "A") = 0
End If
If Cells(loop_num + 1, "C") = True Then
Cells(loop_num, "C") = Cells(loop_num, "B")
Cells(loop_num, "B") = 0
End If
If Cells(loop_num + 1, "D") = True Then
Cells(loop_num, "D") = Cells(loop_num, "C")
Cells(loop_num, "C") = 0
End If
Next
Next
Call rand_num
End Sub
Public Sub rand_num()
Dim cell_row(4)
cell_row(1) = 1
cell_row(2) = 3
cell_row(3) = 5
cell_row(4) = 7
Dim rand_number(2)
rand_number(1) = cell_row(Int((4 - 1 + 1) * Rnd + 1))
rand_number(2) = Int((4 - 1 + 1) * Rnd + 1)
While (Cells(rand_number(1) + 1, rand_number(2)) = False)
rand_number(1) = cell_row(Int((4 - 1 + 1) * Rnd + 1))
rand_number(2) = Int((4 - 1 + 1) * Rnd + 1)
Wend
Cells(rand_number(1), rand_number(2)) = Int((2 - 1 + 1) * Rnd + 1)
Randomize (Timer)
End Sub
Sub Clear()
For loop_num = 1 To 4
Cells(1, loop_num) = 0
Cells(3, loop_num) = 0
Cells(5, loop_num) = 0
Cells(7, loop_num) = 0
Next
Cells(9, "C") = 0
Call rand_num
Call rand_num
End Sub
All suggestions are welcome.