- ©«¤l
- 248
- ¥DÃD
- 55
- ºëµØ
- 0
- ¿n¤À
- 314
- ÂI¦W
- 205
- §@·~¨t²Î
- XP / WIN7
- ³nÅ骩¥»
- 2003 / 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Tainan
- µù¥U®É¶¡
- 2013-10-18
- ³Ì«áµn¿ý
- 2024-11-4
|
ÁÂÁ¤j¤j
·íªì¦n¹³§â¬yµ{·Q±o¤Ó½ÆÂø «¢
«á¨Ó¦³¾ã²z¥XÓ¤èªk
¥Ø«eÀ³¸Ó¥i¦æ
¤£ª¾¦³µL¨ä¥L¤è¦¡
ªþÀɬOª½±µ§âuserA,userB§ì¶i¨Ó¤F
(§â¥~³¡¸ê®Æ¨Ó·½¬Ù²¤)
Ä橳³¡¤ÀªºÄæ¦ì¬OMATCH«á¤~¶ñ¼gªº
userA,userB¤£¯à¶ñ- Sub match_Click()
-
- 'Copy userA
- For i = 2 To Sheets(2).Range("A1").End(xlDown).Row
- '§P§O¨Ó·½¦³µL«½Æ,¥BMATCHªí¨S¦³ªº(¶K³Ì¤U±)
- If Application.match(Sheets(2).Range("D" & i), Sheets(2).Range("D:D"), 0) = i And _
- IsError(Application.match(Sheets(2).Range("D" & i), Range("D:D"), 0)) = True Then
- userA_rows = Range("A65536").End(xlUp).Row + 1
- Sheets(2).Range("A" & i & ":D" & i).Copy Range("A" & userA_rows & ":D" & userA_rows)
- '§P§O¨Ó·½¦³µL«½Æ,¥BMATCHªí¤W¦³ªº(¶K¦bMATCH¦ì¸m)
- ElseIf Application.match(Sheets(2).Range("D" & i), Sheets(2).Range("D:D"), 0) = i And _
- IsError(Application.match(Sheets(2).Range("D" & i), Range("D:D"), 0)) = False Then
- site_A = Application.match(Sheets(2).Range("D" & i), Range("D:D"), 0)
- Sheets(2).Range("A" & i & ":D" & i).Copy Range("A" & site_A & ":D" & site_A)
- End If
- Next
- 'Copy userB
- For j = 2 To Sheets(3).Range("A1").End(xlDown).Row
- '§P§O¨Ó·½¦³µL«½Æ,¥BMATCHªí¨S¦³ªº(¶K³Ì¤U±)
- If Application.match(Sheets(3).Range("D" & j), Sheets(3).Range("D:D"), 0) = j And _
- IsError(Application.match(Sheets(3).Range("D" & j), Range("D:D"), 0)) = True Then
- userB_rows = Range("A65536").End(xlUp).Row + 1
- Sheets(3).Range("A" & j & ":D" & j).Copy Range("A" & userB_rows & ":D" & userB_rows)
- '§P§O¨Ó·½¦³µL«½Æ,¥BMATCHªí¦³ªº(¶K¦bMATCH¦ì¸m)
- ElseIf Application.match(Sheets(3).Range("D" & j), Sheets(3).Range("D:D"), 0) = j And _
- IsError(Application.match(Sheets(3).Range("D" & j), Range("D:D"), 0)) = False Then
- site_B = Application.match(Sheets(3).Range("D" & j), Range("D:D"), 0)
- Sheets(3).Range("A" & j & ":D" & j).Copy Range("A" & site_B & ":D" & site_B)
- End If
- Next
- '»PuserA,userB¤ñ¹ï §R°£¨S¦³ªº
- For x = 2 To Range("A1").End(xlDown).Row
- If IsError(Application.match(Range("D" & x), Sheets(2).Range("D:D"), 0)) = True And _
- IsError(Application.match(Range("D" & x), Sheets(3).Range("D:D"), 0)) = True Then
- Rows(x).Delete
- End If
- Next
- End Sub
½Æ»s¥N½X
match.zip (20.51 KB)
|
|