ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] VBA_¤G­Óµ{¦¡¦X¨Ö«áªº©³¦â¼Ð¥Ü¤§»yªk­×¥¿¡C

¦b¤W¤è¥ý©w¸q¥H¤UÅܼơG
Dim SW, H(1 To 3) As Range, V%
¡@
¡@
RW = Array(b(1, -1), .[T5], .[R6])
SW = Array(.[R6], .[T5], b(1, -1))
For x = 1 To 4
For i = 1 To 3: Set UR(i) = Nothing: Next
¡@¡@For z = 1 To 7
¡@¡@¡@¡@Set R(1) = .[J6].Cells(RW(0) - x + 1, z): U = 0
¡@¡@¡@¡@Set H(1) = .[J6].Cells(SW(0) - x + 1, z): V = 0
¡@¡@¡@¡@For i = 2 To 3
¡@¡@¡@¡@¡@¡@Set R(i) = Nothing
¡@¡@¡@¡@¡@¡@Set R(i) = .[J6:P6].Cells(RW(i - 1) - x + 1, z) '¦PÄæ
¡@¡@¡@¡@¡@¡@If R(i) = R(1) Then U = U + i '¦PÄæ
¡@
¡@¡@¡@¡@¡@¡@Set H(i) = Nothing
¡@¡@¡@¡@¡@¡@Set H(i) = .[J6:P6].Cells(SW(i - 1) - x + 1, z)
¡@¡@¡@¡@¡@¡@If H(i) = H(1) Then V = V + i
¡@¡@¡@¡@Next i
¡@¡@¡@¡@If U = 2 Or V = 2 Then Set UR(1) = Nothing: Exit For
¡@¡@¡@¡@If U = 5 And V = 5 Then
¡@¡@¡@¡@¡@¡@For i = 1 To 3
¡@¡@¡@¡@¡@¡@¡@¡@If UR(i) Is Nothing Then Set UR(i) = R(i) Else Set UR(i) = Union(UR(i), R(i))
¡@¡@¡@¡@¡@¡@Next i
¡@¡@¡@¡@End If
¡@¡@Next z
¡@
¡@¡@If Not UR(1) Is Nothing Then
¡@¡@¡@¡@For i = 1 To 3
¡@¡@¡@¡@¡@¡@For Each R(1) In UR(i): R(1).Interior.ColorIndex = Array(8, 4, 6)(i - 1): Next
¡@¡@¡@¡@Next i
¡@¡@End If
Next x

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD