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

choose and union ºÃ°Ý

choose and union ºÃ°Ý

¦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 'Y­Y¤£¦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

¦^´_ 2# Hsieh
§Ú­nªí¹Fªº«D¦r¦ê,©Ò¥H­×§ï¬°,Set n = Choose(h, Union(Y, x), Union(y1, x), Union(y2, x)),¦ý­YX,Y,Y1,Y2 ¦³1¦U¬Onothing ¤@¼Ë·|¦³°ÝÃD,
³o¼Ëªº¸Ü§Ú­n¦p¦ó­×§ï©O?
§Ú·Q­nªº¬O,·íh=1,«hn=uniob(Y,X),·íh=2,n= Union(y1, x),¨Ì¦¹Ãþ±À,©Ò¥H·Q½Ð°Ý¦³¤°»ò¤èªk¥i¥H§JªA©O?

TOP

¦^´_ 4# GBKEE
§Ú¥i¥H§ï¬°¤U­±ªº¼gªk¶Ü? ³o¼Ë¬O¤£¬O´N«ü©w¤FY,y1,y2
Set n = Choose(h,Y= Union(Y, x), y1=Union(y1, x), y2=Union(y2, x))

TOP

¦^´_ 7# GBKEE
ÁÂÁ«ü¾É,§Úª¾¹D§Úªº°ÝÃD¤F

TOP

        ÀR«ä¦Û¦b : §g¤l¬°¥Ø¼Ð¡A¤p¤H¬°¥Øªº¡C
ªð¦^¦Cªí ¤W¤@¥DÃD