2011年3月7日月曜日

module5


Option Explicit

Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx - 1
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx + n, yy + n).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub
Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx - 1
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx + n, yy).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx - 1
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx + n, yy - n).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx - 0
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx, yy + n).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx - 0
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx, yy - n).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx + 1
yy = yy - 1
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx - n, yy + n).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx + 1
yy = yy - 0
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx - n, yy).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub

Sub white_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(0, 0, 0) Then
cnt = cnt + 1
mark:
xx = xx + 1
yy = yy + 1
If .Cells(xx, yy).Interior.Color = RGB(0, 0, 0) Then
    cnt = cnt + 1
    GoTo mark
ElseIf .Cells(xx, yy).Interior.Color = RGB(255, 255, 255) Then
        For n = 1 To cnt
            .Cells(xx - n, yy - n).Interior.Color = RGB(255, 255, 255)
        Next n
        handan = handan + 1
    End If
End If
End With
End Sub


0 件のコメント:

コメントを投稿