- ©«¤l
- 1447
- ¥DÃD
- 40
- ºëµØ
- 0
- ¿n¤À
- 1471
- ÂI¦W
- 0
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Excel 2010 & 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2020-7-15
- ³Ì«áµn¿ý
- 2024-12-5
|
¦^´_ 15# cowww
Àˬd²¤Æ¤F¤@¤U,¾Ç²ß¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò
Option Explicit
Sub TEST_1()
Application.ScreenUpdating = False
Dim Brr, Z, A, B, i&, R&, T$, T1$, PH$, FN$, xB As Workbook, Sh As Worksheet
Set Z = CreateObject("Scripting.Dictionary")
PH = ThisWorkbook.Path: FN = "²§°Êªí±Æ§Ç.xlsm"
On Error Resume Next
Set xB = Workbooks(FN): Set Sh = xB.Sheets("²§°Êªí±Æ§Ç")
Brr = Range(Sh.[E1], Sh.[A65536].End(3))
On Error GoTo 0
If xB Is Nothing Then
Set xB = Workbooks.Open(PH & "\" & FN)
Brr = Range([²§°Êªí±Æ§Ç!E1], [²§°Êªí±Æ§Ç!A65536].End(3))
xB.Close 0
End If
For i = 1 To UBound(Brr)
T = Brr(i, 2): If T = "" Then GoTo i00
T1 = Brr(i, 1): A = Z(T1)
If A = "" Then
For R = i To UBound(Brr)
If T1 <> Brr(R, 1) Then Z(T1) = A: Exit For
B = " " & Brr(R, 2) & " " & Brr(R, 3) & " " & Brr(R, 4) & " " & Brr(R, 5)
If i = R Then A = Brr(R, 1) & vbLf & B Else A = A & vbLf & B
Next
End If
If Z(T) = "" Then
Z(T) = Z(T1)
ElseIf InStr(Z(T), Z(T1)) = 0 Then
Z(T) = Z(T) & vbLf & vbLf & Z(T1)
End If
i00: Next
Brr = Range([±M®×!D1], [±M®×!D65536].End(3))
[V:V].ClearComments
For i = 1 To UBound(Brr)
T1 = Brr(i, 1): If T1 = "" Or Z(T1) = "" Then GoTo i01
With Cells(i, 22).AddComment
.Text Text:=Replace(Z(T1), " " & T1, "¡¹" & T1)
.Shape.TextFrame.Characters.Font.Size = 16
.Shape.DrawingObject.AutoSize = True
End With
i01: Next
Set Z = Nothing: Erase Brr: Set xB = Nothing: Set Sh = Nothing
End Sub |
|