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

[µo°Ý] ½Ð°Ý¬O§_¦³¿ìªk«ö·Ó·í·Æ¹«ÂI¨ìªº¶¶§Ç¥h±Æ§Ç?(¤w§¹¦¨¡AÁÂHsieh¤j¤j)

¥»©«³Ì«á¥Ñ register313 ©ó 2012-2-15 17:24 ½s¿è

B1.rar (8.3 KB) ¦^´_ 7# av8d

­×§ïHsieh¶Wª©¤§µ{¦¡
2­¿ªºµ{¦¡½X,°Ñ¦Ò

¤u§@ªí¼Ò²Õ
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2. Application.EnableEvents = False
  3. If Target.Count = 1 Then
  4. If Target.Column = 1 Then
  5.     ReDim Preserve Ar(s)
  6.     Ar(s) = Target.Value
  7.     s = s + 1
  8.     [B65536].End(xlUp).Offset(1) = Target
  9.     Target.Delete xlShiftUp
  10. ElseIf Target.Column = 3 Then
  11.     ReDim Preserve Ar1(t)
  12.     Ar1(t) = Target.Value
  13.     t = t + 1
  14.     [D65536].End(xlUp).Offset(1) = Target
  15.     Target.Delete xlShiftUp
  16. End If
  17. End If
  18. Application.EnableEvents = True
  19. End Sub
½Æ»s¥N½X
¤@¯ë¼Ò²Õ
  1. Public Ar(), Ar1(), s&, t&
  2. Sub «ö¶s1_Click()
  3. Application.EnableEvents = False
  4. If (s <> 0) Then
  5. [A1].Resize(s, 1).Insert xlShiftDown
  6. [A1].Resize(s, 1).Value = Application.Transpose(Ar)
  7. Range([B2], [B2].End(xlDown)).ClearContents
  8. s = 0: Erase Ar: Set Rng = Nothing
  9. End If
  10. If (t <> 0) Then
  11. [C1].Resize(t, 1).Insert xlShiftDown
  12. [C1].Resize(t, 1).Value = Application.Transpose(Ar1)
  13. Range([D2], [D2].End(xlDown)).ClearContents
  14. t = 0: Erase Ar1: Set Rng = Nothing
  15. End If
  16. Application.EnableEvents = True
  17. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¯u¥¿ªº·R¤ß¡A¬O·ÓÅU¦n¦Û¤vªº³oÁû¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD