- ©«¤l
- 192
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 194
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2016-9-22
- ³Ì«áµn¿ý
- 2020-8-28
|
¦^´_ 120# c_c_lai
ªþÀɤ¤§Ú¦³¥[¤J³oÓ«ö¶s
¦pªG¤ñ¹ï¬Û¦Pªº¸Ü
§Ú·|¨q¨º¤@Ä檺¾÷¥x"½s¸¹"
¤f»~°ÕQ0Q
- Private Sub CommandButton2_Click()
- Sheets("¶q¤j¥¼±Æ¾÷").Select
- Dim Arr, i&, Brr, aa, j&, x$, Myr&
- Dim d, k, t
- Set d = CreateObject("Scripting.Dictionary")
- Sheets("¶q¤j¥¼±Æ¾÷").Activate
- '¤ñ¹ï"TR±Æ¾÷&²£¥X" ¦Ç¦âÄæ¦ì"E""F""G""H"¤ñ¹ï"¶q¤j¥¼±Æ¾÷"§ä¨ì¤@¼Ëªº¡A¨q¤W"TR±Æ¾÷&²£¥X"ªº"B"Äæ¦P¤@¦Cªº¾÷¥x½s¸¹
- With Sheets("TR±Æ¾÷&²£¥X")
- Myr = .Cells(.Rows.Count, 12).End(xlUp).Row
- Arr = .Range("a1:p" & Myr)
- End With
- For i = 4 To UBound(Arr) Step 5
- If Not IsError(Arr(i, 5)) Then '& "|" & Arr(i, 6) & "|" & Arr(i, 7) & "|" & Arr(i, 8)
- x = Arr(i, 5) & "|" & Arr(i, 6) & "|" & Arr(i, 7) & "|" & Arr(i, 8)
- d(x) = d(x) & i & ","
- End If
- Next
- Brr = [a1].CurrentRegion
-
- For i = 2 To UBound(Brr) Step 5
- x = Brr(i, 1) & "|" & Brr(i, 2) & "|" & Brr(i, 3) & "|" & Brr(i, 4)
- If d.exists(x) Then
- t = d(x)
- t = Left(t, Len(t) - 1)
- If InStr(t, ",") Then
- aa = Split(t, ",")
- For j = 0 To UBound(aa)
- Cells(i, 9 + j) = Arr(aa(j), 2)
- Next
- Else
- Cells(i, 9) = Arr(t, 2)
- End If
- End If
- Next
- '¥Dn·Q³]¸m"H"Äæ¼Æ¶q¥Ñ¤j¦Ü¤p¡A³oÃä¥H¿ý»s¥¨¶°¨Ï¥Î
- ActiveWorkbook.Worksheets("¶q¤j¥¼±Æ¾÷").AutoFilter.Sort.SortFields.Clear
- ActiveWorkbook.Worksheets("¶q¤j¥¼±Æ¾÷").AutoFilter.Sort.SortFields.Add Key:=Range( _
- "H1:H500"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
- xlSortNormal
- With ActiveWorkbook.Worksheets("¶q¤j¥¼±Æ¾÷").AutoFilter.Sort
- .Header = xlYes
- .MatchCase = False
- .Orientation = xlTopToBottom
- .SortMethod = xlPinYin
- .Apply
- End With
- End Sub
½Æ»s¥N½X |
|