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

[µo°Ý] ¿z¿ï?ÃöÁä¦r?¬d¸ß?

¦^´_ 9# GBKEE

GBKEEª©¤j±z¦n

¤£¦n·N«ä¡A·Q¦A¦V±z½Ð±Ð¤@¤U¡A¤§«e³]±ø¥ó¬O§Æ±æSheet1¡÷Sheet2ªº¸ê®Æ¨C¤@µ§¥u¯à³Q«Ø¸m¤@¦¸¤£¥i­«½Æ«Ø¸m¡A
²{¦b¦pªG·Q§ï¦¨¤¹³\¦P¤@µ§¸ê®ÆµL­­¦¸¼Æ¥i¥HÂI¤@¦¸AÄæ¬YÀx¦s®æ´N¥X²{¦ÜSheet2¤@¦¸ªº¸Ü¡A¸Ó¦p¦ó§ó§ïµ{¦¡©O?
§Ú­ì¥ý¥H¬°¬O¡uIf Not Application.Intersect(Range("A4", Range("A4").End(xlDown)), Target) Is Nothing Then¡v
³o¦CªºÃö«Y¡A¦ý§Ú§â³o¦æ®³±¼«á¡AÁÙ¬O¤@µ§¥u¯à¥X²{¤@¦¸¡A¬°¤°»ò©O?

¥t¥~¡A¦pªG¨Ï¥ÎªÌ¤£¤p¤ßÂI¿ù¡A©Î¬OÂI¤F¤§«á·Q±qSheet2±N¬Yµ§²¾°£ªº¸Ü¡A¥i¥H¶Ü?²¾°£ªº¤è¦¡¥i¥H¸òSheet1¤@¼Ë¡A
¨Ò¦pÂI¿ïA8ªºÀx¦s®æ¡A´N±NA8¾ã¦C²¾°£A9¦C»¼¸É¤WA8¨º¦Cªº¦ì¸m¶Ü?

ÁÂÁÂ^^

TOP

¦^´_ 11# emma
¸Õ¸Õ¬Ý
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)    '¤¹³\¦P¤@µ§¸ê®ÆµL­­¦¸¼Æ¥i¥HÂI¤@¦¸AÄæ¬YÀx¦s®æ´N¥X²{¦ÜSheet2¤@¦¸
  2.     Dim Target_Row As String
  3.     If Not Application.Intersect(Range("A4", Range("A4").End(xlDown)), Target) Is Nothing Then
  4.        'Intersectª«¥ó:  Target¥]§t¦bRange("A4", Range("A4").End(xlDown))*** ¤~­n°õ¦æ ***
  5.         Target_Row = Target(, 1) & "," & Target(, 3) & "," & Target(, 5)    '³o¸Ì¦Û¦æ­×§ï ³s±µ¤£³sÄò¦ì¸m
  6.        Sheets("sheet2").Range("a" & Rows.Count).End(xlUp).Offset(1).Resize(, 3) = Split(Target_Row, ",")
  7.         'Split ¨ç¼Æ: ¶Ç¦^¤@­Ó³¯¦C¯Á¤Þ±q¹s¶}©lªº¤@ºû°}¦C¡A¥¦¥]§t«ü©w¼Æ¥Øªº¤l¦r¦ê¡C
  8.     End If
  9. End Sub
  10. Sub Ex()  'ªG¨Ï¥ÎªÌ¤£¤p¤ßÂI¿ù:­è­èÂI¿ù ©Î §R¥þ³¡
  11.     Dim Target_Row As String, xi As Integer
  12.     If Not Application.Intersect(Range("A4", Range("A4").End(xlDown)), ActiveCell) Is Nothing Then
  13.         Target_Row = ActiveCell & "," & ActiveCell(, 3) & "," & ActiveCell(, 5)    '³o¸Ì¦Û¦æ­×§ï ³s±µ¤£³sÄò¦ì¸m
  14.         With Sheets("sheet2")
  15.             xi = .Range("a" & Rows.Count).End(xlUp).Row
  16.             Do While xi > 7
  17.                 If .Cells(xi, 1) & "," & .Cells(xi, 2) & "," & .Cells(xi, 3) = Target_Row Then
  18.                     .Cells(xi, 1).Resize(, 3).Delete xlUp
  19.                     Exit Sub  '­è­èÂI¿ù ¥u§R¤@¦¸  ***±N¦¹¦¨¦æµù¸Ñ±¼ ¥i§R¥þ³¡
  20.                 End If
  21.                 xi = xi - 1
  22.             Loop
  23.        End With
  24.     End If
  25. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ emma ©ó 2012-11-6 18:55 ½s¿è

¦^´_ 12# GBKEE


    ÁÂÁÂGBKEEª©¥D¡A¸g´ú¸Õªºµ²ªG
    1.¤¹³\¦P¤@µ§¸ê®ÆµL­­¦¸¼Æ¥i¥HÂI¤@¦¸AÄæ¬YÀx¦s®æ´N¥X²{¦ÜSheet2¤@¦¸¡A³o³¡¥÷ÁöµM°õ¦æ¨S¦³°ÝÃD¡A¦ý¬O¹ê»Ú¨Ï¥Î«á«oı±o¤£¦n¨Ï¥Î
       ¦]¬°¥²»ÝÂ÷¶}­ìÀx¦s®æ¦ì¸m¤§«á¡A¦A­«·sÂI¿ï¤~·|¥X²{¦ÜSheet2¤@¦¸¡A¨Ò¦pÂI¤FA8¡A¦ý¨S¦³Â÷¶}A8ªº¦ì¸m¦AÂI¤@¦¸A8
       ¬O¨S¿ìªkÄ~Äò·s¼W¨ìSheet2ªº¡C
    2.Sub Ex()  '¦pªG¨Ï¥ÎªÌ¤£¤p¤ßÂI¿ù:­è­èÂI¿ù ©Î §R¥þ³¡¡A³o¬q´N§¹¥þ¨S¦³¤ÏÀ³¡A¤£¾å±o¬O§Ú­þ¸Ì¦³²¨¥G±¼ªº¦a¤è?
    ·|¦bSheet2©ÒÂI¿ïªºAÄæ¬YÀx¦s®æ®Ç¥X²{¡u!¡vµe­±¦p¤U¹Ï¡õ
    1.jpg
   

    µM«á¡A¤£¦n·N«ä¡A§Ú¥i¥H¦A§ïÅܤ@¤U¨Ï¥Îªº¤è¦¡¶Ü?
    ·Q§ïÅܤ覡¬O¦pªG¦bZip Code«e­±¦h¤@Ä浧¼Æ¡A¨Ò¦p¦bA8¿é¤J©Ò·Q­nªºµ§¼Æ3µ§«áÂ÷¶}A8¡AA6¿é¤J©Ò·Q­nªºµ§¼Æ7µ§«áÂ÷¶}A6
    ¨ºSheet2·|¥X²{3µ§A8¦Cªº«ü©wÄæ¦ì¡B7µ§A6¦Cªº«ü©wÄæ¦ì¡A¦^¥hSheet1­×§ïA8µ§¼Æ5µ§¡B­×§ïA6µ§¼Æ4µ§¡A
    ³Ì«áSheet2´N·|§ï¬°5µ§A8¦C¤Î4µ§A6¦Cªº«ü©wÄæ¦ì¡A³o¼Ë¥i¦æ¶Ü?
    ¤£¦n·N«ä¡A¤£¾å±o¯à¤£¯à©ú½Tªí¹F§Úªº·N«ä¡A¤j­P³Ì«á·Q§e²{µ²ªGµe­±¦p¤U:dizzy:
   

ªþ¥ó VBA¾Ç²ßÀ³¥Î10111-2.rar (854.53 KB)

TOP

¦^´_ 13# emma
Àx¦s®æ®Ç¥X²{¡u!¡v                                                                                                         ¨º¬O¿ù»~Àˬdªº´£¥Ü¥\¯àªí,¥i¹î¬Ý¤u¨ã->¿ï¶µ ->¿ù»~Àˬd
Sub Ex()  '¦pªG¨Ï¥ÎªÌ¤£¤p¤ßÂI¿ù:­è­èÂI¿ù ©Î §R¥þ³¡¡A³o¬q´N§¹¥þ¨S¦³¤ÏÀ³¡A Ex() ³oµ{¦¡ ¤£·| ¦Û°Ê°õ¦æªº.¥¦¤£¬O¤u§@ªíªºÄ²°Ê¨Æ¥ó

  1. Option Explicit
  2. Private Sub Worksheet_Change(ByVal Target As Range)             '***¥¦¬O¤u§@ªíªºÄ²°Ê¨Æ¥ó ***
  3.     Dim Target_Row As String
  4.     If Target.Address(0, 0) = "D1" Then
  5.         Range("F3").AutoFilter Field:=6, Criteria1:="*" & Target & "*"
  6.     ElseIf Target.Address(0, 0) = "B1" Then
  7.         Range("B3").AutoFilter Field:=2, Criteria1:="*" & Target & "*"
  8.     ElseIf Not Application.Intersect(Range("b4", Range("b4").End(xlDown)).Offset(, -1), Target) Is Nothing Then
  9.         Target_Row = Target(, 2) & "," & Target(, 3) & "," & Target(, 4) & "," & Target(, 5) & "," & Target(, 6)
  10.         §ïÅܨϥΪº¤è¦¡ Target.Value, Target_Row
  11.     End If
  12. End Sub
  13. Private Sub §ïÅܨϥΪº¤è¦¡(¶Ç°e¦¸¼Æ As Integer, ±µ¦¬¦r¦ê As String)
  14.     Dim xi  As Integer, xi_¦¸¼Æ As Integer, xi_¦r¦ê, Rng As Range
  15.     With Sheet2
  16.         xi = 7
  17.         Do While .Cells(xi, 1) <> ""
  18.             xi_¦r¦ê = Join(Application.Transpose(Application.Transpose(.Cells(xi, 1).Resize(, 5))), ",")
  19.             If xi_¦r¦ê = ±µ¦¬¦r¦ê Then
  20.                 If xi_¦¸¼Æ < ¶Ç°e¦¸¼Æ Then
  21.                     xi_¦¸¼Æ = xi_¦¸¼Æ + 1
  22.                 ElseIf xi_¦¸¼Æ = ¶Ç°e¦¸¼Æ Then
  23.                     If Rng Is Nothing Then Set Rng = .Cells(xi, 1) Else Set Rng = Union(Rng, .Cells(xi, 1))
  24.                 End If
  25.             End If
  26.             xi = xi + 1
  27.         Loop
  28.         If xi_¦¸¼Æ < ¶Ç°e¦¸¼Æ Then
  29.             For xi = xi To xi + ¶Ç°e¦¸¼Æ - xi_¦¸¼Æ - 1
  30.                 .Cells(xi, 1).Resize(, 5) = Split(±µ¦¬¦r¦ê, ",")
  31.             Next
  32.             .Range("A6").CurrentRegion.Sort Key1:=.Range("A7"), Order1:=xlAscending, Key2:=.Range( _
  33.                         "B7"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
  34.                         :=False, Orientation:=xlTopToBottom, SortMethod:=xlStroke, DataOption1:= _
  35.                         xlSortNormal, DataOption2:=xlSortNormal
  36.         ElseIf Not Rng Is Nothing Then
  37.             Rng.EntireRow.Delete
  38.         End If
  39.     End With
  40. End Sub
½Æ»s¥N½X

TOP

¦^´_ 14# GBKEE


    GBKEEª©¤j¡AÁÂÁ±z¡A¥i¥H¥¿±`°õ¦æ¨S¦³°ÝÃD¡A§Ú¦b²Ä¤@®É¶¡´N¬Ý¨ì±z¦^´_ªº¤å¤F¡A
    ¦ý¸Õ¤F¦Ñ¥b¤Ñªº­ì¦]¬O§Ú·Q¤Ó¦h¤F¡A§Ú¥H¬°±z¦bµ¹§Ú¥X¦ÒÃD¡A
    ­n¦Û¦æ¥h´M§ä¡u§ïÅܨϥΪº¤è¦¡¡v¡B¡u¶Ç°e¦¸¼Æ¡v¡B¡u±µ¦¬¦r¦ê¡v...µ¥¤¤¤å¦r³¡¥÷ªºµª®×¡A
    ©ó¬O´N·d¯º¤F@"@¡A³Ì«áª½±µ¶K¤W±zªºµ{¦¡¤@¦r¥¼§ï¤Ï¦Ó´N¥¿±`¤F~"~
    §Ú¦b¦Û¦æ¦n¦n¬ã¨s¤@¤U¡A«D±`ªº·PÁ±z^^

TOP

¦^´_ 15# emma


·PÁ¨â¦ì¡A¤@¦ì´£¨Ñ·Qªk¡A¤@¦ì´£¨Ñ¤èªk...¬OÆZ¹ê¥Îªº§Þ¥©....¦hÁÂ...
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 14# GBKEE


    GBKEEª©¤j±z¦n¡A¦³¤@­Ó¦a¤è·Q¦b¦V±z½Ð±Ð¤@¤U¡A´N¬O§Ú¦bSheet1´¡¤J¤@Äæ¦ì©óAÄ檺¦ì¸m¨ÃÁôÂáA¦¹Äæ¹w³Æ¬°¯Á¤ÞÄæ¦ì¥Î¡A
    ¦ý¦b¨Ï¥Î¹Lµ{¤¤¦p¥¼¦ÜSheet2ÂI¿ï¡i²M°£¡jªº«ö¶s«e¡A¥\¯à¤@¤Á¥¿±`¡A¦ýÂI§¹«ö¶s«á¡A´N·|¦³¿ù»~¡A
    ¸Õ¹L´X­Ó¤è¦¡¡A¦ý¤£©ú¥Õ¬°¤°»ò·|¦³³o¼Ëªº¿ù»~¡A©Ò¥H·Q¦A¦V±z½Ð±Ð¤@¤U¡A
    °ÝÃD«Ü¹³¬O¥X²{¦bSheet1.UsedRange.Range("B4:B60300").Clear³o¬q¡A¬O¦]¬°¿z¿ïªºÃö«Y¶Ü?
  1. Sub ²M°£_Click()
  2.     Sheet2.UsedRange.Offset(1, 0).Clear
  3.     Sheet1.UsedRange.Range("B4:B60300").Clear  '³o¬q¦pªG®³±¼ªº¸Ü¡A´N¤£·|¦³°ÝÃD¡A¦ý¤S§Æ±æ¨Ï¥ÎªÌ¦b¥Îªº®É­ÔBÄæ¥i¥H²M°£­«·s¿é¤J·Q­nªºµ§¼Æ
  4. End Sub
½Æ»s¥N½X





VBA¾Ç²ßÀ³¥Î10111-03.rar (861.73 KB)
³Â·Ð±z¤F¡AÁÂÁÂ^^

TOP

¦^´_ 17# emma
­×§ï¦p¤U Targetªº²Ä¤@­ÓCells(1)
  1. Target_Row = Target(, 2) & "," & Target(, 3) & "," & Target(, 4) & "," & Target(, 5) & "," & Target(, 6)
  2. §ïÅܨϥΪº¤è¦¡ Target.Cells(1).Value, Target_Row
½Æ»s¥N½X


¦]¬°Sheet1.UsedRange..Range("B4:B60300").Clear ªº½d³ò ¾É­P
Private Sub Worksheet_Change(ByVal Target As Range)     
¶Ç¦^ Target<=>.Range("B4:B60300") ¤£¬O³æ¤@ªºÀx¦s®æ

§ïÅܨϥΪº¤è¦¡  Target.Value ¬O±µ¦¬³æ¤@ªº­È **©Ò¥H«¬ºA¤£¦P

TOP

¦^´_ 18# GBKEE


    GBKEEª©¤j¡AÁÂÁ±z¡A¤w¨S¦³¥X¿ù»~ªº°T®§¡A¦A¦V±z½Ð±Ð¤@¤U¡A²M°£«ö¶sªº¡õ³o¬q¬O¤£¬OµLªk²M°£¦]¿z¿ï¦ÓÁôÂð_¨ÓªºÀx¦s®æ
   ¦pªG­n±N³QÁôÂð_¨ÓÀx¦s®æ¸Ì­±ªº­È¤@°_²M°£¡A¬O­nÅýSheet1§â¿z¿ïªºÄæ¦ì³£©ñ¶}¦A°õ¦æ²MªÅ¶Ü?ÁÂÁ±z^^
  1.     Sheet1.UsedRange.Range("B4:B60300").Clear
½Æ»s¥N½X

TOP

¦^´_ 19# emma
³o°ÝÃD§A¸Õ¸Õ´Nª¾¹D

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤H¤£©È¿ù¡A´N©È¤£§ï¹L¡A§ï¹L¨Ã¤£Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD