2011年3月7日月曜日

module2


Option Explicit

Sub black_hidariue(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx - 1
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx - 1
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx + n, yy + n).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub
Sub black_ue(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx + n, yy).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub black_migiue(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx - 1
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx - 1
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx + n, yy - n).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub black_hidari(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx - 0
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx - 0
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx, yy + n).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub black_migi(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx - 0
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx - 0
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx, yy - n).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub black_hidarisita(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx + 1
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx + 1
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx - n, yy + n).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub black_sita(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx + 1
yy = yy - 0
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx + 1
yy = yy - 0
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx - n, yy).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub black_migisita(x As Integer, y As Integer, handan As Integer)
Dim xx As Integer, yy As Integer, cnt As Integer, n As Integer
xx = x
yy = y
With Sheet1
cnt = 0
xx = xx + 1
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
cnt = cnt + 1
mark:
xx = xx + 1
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
        For n = 1 To cnt
            .Cells(xx - n, yy - n).Interior.Color = RGB(0, 0, 0)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

0 件のコメント:

コメントを投稿