- ©«¤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
|
¥»©«³Ì«á¥Ñ Andy2483 ©ó 2023-11-24 18:31 ½s¿è
¦^´_ 2# Ãz¨x¹F¤H
ÁÂÁ«e½úµoªí¦¹¥DÃD»P½d¨Ò
«á¾ÇÂǦ¹©«¾Ç²ß¨ì«Ü¦hª¾ÃÑ,¾Ç²ß¤è®×¦p¤U,½Ð«e½ú°Ñ¦Ò
°õ¦æµ²ªG:
Option Explicit
Sub TEST()
Dim Brr, Z, i&, j%, c%, K, T$, T1$, T2$, T3$
Dim xR As Range, Ra As Range, Sh As Worksheet, xBook As Workbook
Set Z = CreateObject("Scripting.Dictionary")
Brr = Range([mapping!B2], [mapping!A65536].End(3))
For i = 1 To UBound(Brr): Z(Brr(i, 1)) = Brr(i, 2): Next
Brr = Range([source!B3], [source!A65536].End(3))
For i = 1 To UBound(Brr)
T = Trim(Replace(Replace(Replace(Replace(Brr(i, 1), Chr(10), ""), Chr(9), ""), Chr(7), ""), Chr(13), ""))
If T = "" Or (InStr(T, "_") + InStr(T, "-")) = 0 Then Brr(i, 1) = "": GoTo i01
If InStr(T & "_", "_") > InStr(T & "-", "-") Then
T = Left(T, InStr(T, "-") - 1) & "_" & Mid(T, InStr(T, "-") + 1)
End If
T1 = Left(T, InStr(T, "_"))
T2 = Mid(T, InStr(T, "_") + 1)
For Each K In Z.Keys: T3 = IIf(InStr(T, K), T3 & "/" & Z(K), T3): Next
Brr(i, 1) = T1 & T2 & ";" & Val(Brr(i, 2)) & ":" & Mid(T3, 2)
T3 = ""
i01: Next
[C3].Resize(UBound(Brr)) = Brr
End Sub |
|