¦bVBA µ{¦¡¤¤ ¨Ï¥Îset n=choose(h,union(y,x),union(y1,x),union(y2,x)) ,°õ¦æ®É,¦¹¦a¤è·|¦³°ÝÃD,½Ð±Ðþ¸Ì¦³°ÝÃD
¸Ô²Óµ{¦¡¦p¤U:
Dim x As Range, Y As Range, rng As Range, r As Long '«Å§iÅܼÆ
Dim y1 As Range, y2 As Range
For h = 1 To 3
r = Cells(65536, 52 + h).End(xlUp).Row '¨úªºAÄæ³Ì¤j¦C¦ì
Set m = Choose(h, Y, y1, y2)
Set rng = Range("ba2:ba" & r) '¨ú±o¸ê®Æ½d³ò
For Each x In rng '¸ê®Æ½d³ò¤º¨C¤@Àx¦s®æ
If x = "" Then 'YÀx¦s®æȬ° ""
If m Is Nothing Then 'YY¤£¦s¦b
Set m = x '±NY³]©w¬°x
Else 'YY¦s¦b
Set n = Choose(h, "Union(Y, x)", "Union(y1, x)", "Union(y2, x)")
m = n
End If
End If
Next
If Not m Is Nothing Then m.Delete (xlUp) 'YY¦s¦b±NY§R°£
Next |