- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 255
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-24
|
¥»©«³Ì«á¥Ñ Hsieh ©ó 2012-8-6 22:38 ½s¿è
¦^´_ 23# °²±¶W¤H - Sub nn()
- Dim Ar(), A As Range, B As Range
- With Sheets("Sheet1")
- For Each A In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp)) '²Ä¤@¶A2¥H¤U°µ°j°é
- For Each Sh In Sheets(Array("Sheet2", "Sheet3")) 'ì¸ê®Æ©Ò¦b¤u§@ªí
- With Sh
- For Each B In .Range(.[A2], .Cells(.Rows.Count, 1).End(xlUp)) '¦bA2¥H¤UÀx¦s®æ°µ°j°é
- If B = A Then '¸ò²Ä¤@¶AÄæÀx¦s®æ°µ¤ñ¹ï¡A¦pªG²Å¦X
- ReDim Preserve Ar(s) 'ÂX¤j°}¦C
- Ar(s) = Array(B.Value, B.Offset(, 1).Value, B.Offset(, 2).Value, B.Offset(, 4).Value) '±Nȼg¤J°}¦C
- s = s + 1 '·Ç³Æ¤U¤@¦¸ÂX¤j°}¦C
- End If
- Next
- End With
- Next
- With Sheets("³Ì²×µ²ªG")
- If s > 0 Then .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Resize(s, 4).Value = Application.Transpose(Application.Transpose(Ar)) Else _
- .Cells(.Rows.Count, 1).End(xlUp).Offset(1).Resize(, 4).Value =Array(A.value,"","","") '¦pªG°}¦C¦³¤º®e¡A´N±N°}¦C¼g¤Jµ²ªG¡A§_«h¼g¤J¤@¦CªÅ¥Õ
- Erase Ar: s = 0 '²MªÅ°}¦C¡A¨Ã·Ç³Æ¤U¤@Ó°}¦Cªì©l¤j¤p
- End With
- Next
- End With
- End Sub
½Æ»s¥N½X 17¦CªºIf³¯z¦¡¡A¦]¬°If...Then...¦b¦P¤@¦æ©Ò¥H¤£¶·End If¸Ô²Ó»yªk½Ð°Ñ¦ÒVBA»¡©ú |
|