- ©«¤l
- 406
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 453
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOWS 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2015-2-7
- ³Ì«áµn¿ý
- 2021-7-31
|
¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-8-23 13:47 ½s¿è
¦^´_ 16# b9208 '
¦]¬°³o¬OCtrl+A (CurrentRegion)ªº®ÄªG......ì¨Ó²Ä3¦C¤£¤@©w·|¬OªÅ¥Õªü
קïArr§ì¨ú¸ê®Æ½d³ò´N¥i¥H¤F
µ{¦¡¦p¤U
Sub ²Îp¤J¤f()
[B6].CurrentRegion.Offset(2).Clear
²Îp [B6], 8
End Sub
Sub ²Îp¥X¤f()
[P6].CurrentRegion.Offset(2).Clear
²Îp [P6], 9
End Sub
Sub ²Îp(ByVal cel0 As Range, Ci As Long)
Dim D, Arr, Brr, T$, K1$, K2$, Key, R&, Ro&, Co&, Rg As Range
Set D = CreateObject("Scripting.Dictionary")
Arr = [¸ê®Æ!A4].Resize([¸ê®Æ!B4].End(4).Row - 3, 9)
For R = 2 To UBound(Arr)
K1 = Arr(R, 2): K2 = Arr(R, Ci)
If K1 <> T Then Ro = Ro + 1: D(K1) = Ro: T = K1
If K2 <> "" Then Key = K1 & "-" & K2: D(Key) = D(Key) + 1
Next
ReDim Brr(1 To Ro, 1 To 11)
For Each Key In D.keys
If InStr(Key, "-") = 0 Then Brr(D(Key), 1) = Key: GoTo ¤UÓKey
Ro = D(Split(Key, "-")(0))
Set Rg = cel0.Resize(, 10).Find(Split(Key, "-")(1), , , xlWhole)
If Not Rg Is Nothing Then
Co = Rg.Column - cel0.Column + 1
Brr(Ro, Co) = D(Key): Brr(Ro, 11) = Brr(Ro, 11) + D(Key)
End If
¤UÓKey: Next
With cel0(2).Resize(Ro, 11)
.Value = Brr: .Borders.LineStyle = 1
.VerticalAlignment = xlBottom
.HorizontalAlignment = xlCenter
End With
End Sub |
|