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

[µo°Ý] ¼W¥[¦P¦WºÙ¤u§@ªí¨Ã±N¸ê®Æ½Æ»s¨ì·s¤u§@ªí

[µo°Ý] ¼W¥[¦P¦WºÙ¤u§@ªí¨Ã±N¸ê®Æ½Æ»s¨ì·s¤u§@ªí

¦U¦ì«e½ú
½Ð±Ð¼W¥[¦P¦WºÙ¤u§@ªí¨Ã±N¸ê®Æ½Æ»s¨ì·s¤u§@ªí
¨Ì·ÓÀx¦s®æ¤º®e¼W¥[¦P¦WºÙ¤u§@ªí¨Ã±N¸ê®Æ½Æ»s¨ì·s¤u§@ªí
¦pªþÀÉ¡G
¨Ì¾ÚÁ`ªí¤º©m¦WÄæ¦ì¡A¼W¥[¦P©m¦W¦WºÙ¤§¤u§@ªí¡A¨Ã±N¦U©m¦W¸ê®Æ­È½Æ»s¨ì¦U¤u§@ªí¤¤¡C
¨Ò¦p¡G¥Ò¡B¤A¤u§@ªí
½Ðª`·N¦bÁ`ªí¸Ì¦³¹BExcel ¨ç¼Æ
Àµ¤Á½Ð¨D¥ý¶i­Ì«ü¾É

WORK.rar (12.16 KB)
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

  1. Sub Ex()
  2. Dim Sht(), Rng As Range, Ar(), A As Range
  3. Set d = CreateObject("Scripting.Dictionary")
  4. Set d1 = CreateObject("Scripting.Dictionary")
  5. For Each sh In Sheets
  6. ReDim Preserve Sht(s)
  7. Sht(s) = sh.Name
  8. s = s + 1
  9. Next
  10. With ¤u§@ªí1
  11. Set Rng = .[B2:O3]
  12. For Each A In .Range(.[D5], .[D5].End(xlDown))
  13.    d1(A.Value) = d1(A.Value) + 1
  14.    If IsEmpty(d(A.Value)) Then
  15.    ReDim Preserve Ar(0)
  16.    Ar(0) = Array(d1(A.Value), A.Offset(, -1).Value, A.Value, A.Offset(, 1).Value, A.Offset(, 2).Value, A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 5).Value, A.Offset(, 6).Value, A.Offset(, 7).Value, A.Offset(, 8).Value, A.Offset(, 9).Value, A.Offset(, 10).Value, A.Offset(, 11).Value)
  17.    d(A.Value) = Ar
  18.    Else
  19.    Ar = d(A.Value)
  20.    k = UBound(Ar)
  21.    ReDim Preserve Ar(k + 1)
  22.    Ar(k + 1) = Array(d1(A.Value), A.Offset(, -1).Value, A.Value, A.Offset(, 1).Value, A.Offset(, 2).Value, A.Offset(, 3).Value, A.Offset(, 4).Value, A.Offset(, 5).Value, A.Offset(, 6).Value, A.Offset(, 7).Value, A.Offset(, 8).Value, A.Offset(, 9).Value, A.Offset(, 10).Value, A.Offset(, 11).Value)
  23.    d(A.Value) = Ar
  24.    End If
  25. Next
  26. End With
  27. For Each ky In d.keys
  28.   If IsError(Application.Match(ky, Sht, 0)) Then
  29.   With Worksheets.Add(after:=Sheets(Sheets.Count))
  30.   .Name = ky
  31.   End With
  32.   End If
  33.   With Sheets(ky)
  34.   .Cells.Clear
  35.   .[F:G].NumberFormat = "h:m"
  36.   Rng.Copy .[B2]
  37.   Ar = d(ky)
  38.   With .[B4].Resize(UBound(d(ky)) + 1, 14)
  39.   .Value = Application.Transpose(Application.Transpose(Ar))
  40.   .Borders.LineStyle = 1
  41.   End With
  42.   End With
  43. Next
  44. End Sub
½Æ»s¥N½X
¦^´_ 1# b9208
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ register313 ©ó 2012-3-4 23:57 ½s¿è
  1. Sub Filter()
  2. Sheets("Á`ªí").Select
  3. C = Sheets("Á`ªí").[B65536].End(xlUp).Row
  4. D = Sheets("¸ê®Æ®w").[E65536].End(xlUp).Row
  5. Rng2 = Sheets("¸ê®Æ®w").Range("E4:E" & D)
  6. With Sheets("Á`ªí")
  7.   For Each R In Rng2
  8.      For Each sh In ThisWorkbook.Sheets
  9.        Application.DisplayAlerts = False
  10.        If sh.Name = R Then
  11.           sh.Delete
  12.        End If
  13.        Application.DisplayAlerts = True
  14.      Next
  15.      Set sh = Sheets.Add(after:=Sheets(Sheets.Count))
  16.      sh.Name = R
  17.      .Range("B4:O" & C).AutoFilter Field:=3, Criteria1:=R
  18.      If .FilterMode Then
  19.         .AutoFilter.Range.SpecialCells(12).Copy Sheets(R).Cells(3, 2)
  20.         .Rows("2:3").Copy Sheets(R).Cells(2, 1)
  21.      End If
  22.      Sheets(R).Select
  23.      For Each A In Range("D4:D" & [D65536].End(xlUp).Row)
  24.          If A <> "" Then
  25.             A.Offset(0, -2) = A.Row - 3
  26.          End If
  27.      Next
  28.   Next
  29.   .Range("B4:O" & C).AutoFilter
  30. End With
  31. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# Hsieh
«D±`·PÁ Hsieh ª©¥D
±Nµ{¦¡½X¸m©ó¤u§@ªí¡ªÁ`ªí¡ª¤º¡A°õ¦æµ²ªGÅã¥Ü¡ª°}¦C¯Á¤Þ¶W¥X½d³ò¡ª¡C
¬d¬Ý¦h¦¸¡AÁÙ¬OµLªk¸Ñ¨M¡C
Àµ½Ðª©¥D¦A¦¸«ü¾É
ÁÂÁÂ
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 2# Hsieh
ÁÂÁ Hsieh ª©¥D
¤v§ä¨ì°ÝÃD¨Ã¸Ñ¨M¤F
With Sheets("Á`ªí")
«D±`·PÁÂ
¦A¤@¦¸·PÁÂ
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 3# register313
«D±`ÁÂÁ«e½ú«ü¾É
¦ý°õ¦æ«á¡A¥u¦³ªíÀY½Æ»s¡A¨ä¤U¸ê®Æ¨Ã¥¼½Æ»s¡C
ÁÂÁÂ
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 6# b9208
²¤§@­×§ï
  1. Sub Filter()
  2. Sheets("Á`ªí").Select
  3. C = Sheets("Á`ªí").[B65536].End(xlUp).Row
  4. D = Sheets("¸ê®Æ®w").[E65536].End(xlUp).Row
  5. Rng2 = Sheets("¸ê®Æ®w").Range("E4:E" & D)
  6. With Sheets("Á`ªí")
  7.   For Each R In Rng2
  8.      For Each sh In ThisWorkbook.Sheets
  9.        Application.DisplayAlerts = False
  10.        If sh.Name = R Then
  11.           sh.Delete
  12.        End If
  13.        Application.DisplayAlerts = True
  14.      Next
  15.      Set sh = Sheets.Add(after:=Sheets(Sheets.Count))
  16.      sh.Name = R
  17.      .Range("B4:O" & C).AutoFilter Field:=3, Criteria1:=R
  18.      If .FilterMode Then
  19.         .AutoFilter.Range.SpecialCells(12).Copy Sheets(R).Cells(3, 2)
  20.         .Rows("2:3").Copy Sheets(R).Cells(2, 1)
  21.      End If
  22.      Sheets(R).Select
  23.      For Each A In Range("D4:D" & [D65536].End(xlUp).Row)
  24.          If A <> "" Then
  25.             A.Offset(0, -2) = A.Row - 3
  26.          End If
  27.      Next
  28.   Next
  29.   .Range("B4:O" & C).AutoFilter
  30. End With
  31. End Sub
½Æ»s¥N½X
WORK.rar (22.12 KB)

TOP

¦^´_ 7# register313
ÁÂÁ«e½ú
¥i¥H¨Ï¥Î¤F
100 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD