- ©«¤l
- 976
- ¥DÃD
- 7
- ºëµØ
- 0
- ¿n¤À
- 1018
- ÂI¦W
- 0
- §@·~¨t²Î
- Win10
- ³nÅ骩¥»
- Office 2016
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-4-19
- ³Ì«áµn¿ý
- 2024-10-30
|
¦^´_ 3# wayne0303
½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ
Sub test()
Dim Arr, xD, T$, w1$, w2$, i&, j&, k%
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range("d3:w16")
For i = 2 To UBound(Arr) Step 6
k = k + 1
For j = 1 To UBound(Arr, 2)
T = Arr(i, j): If T = "" Then GoTo 99
xD(T & "_" & k) = Arr(i - 1, j)
Next j
99: Next i
Arr = Range("a5:a" & [a5].End(4).Row)
For i = 1 To UBound(Arr)
w1 = Left(Arr(i, 1), 1)
w2 = Mid(Arr(i, 1), 2, 1)
If Asc(w1) > 64 And Asc(w1) < 123 And Asc(w2) > 64 And Asc(w2) < 123 Then
If UCase(w1) = "L" Then
T = Mid(Arr(i, 1), 2, 4) & "/" & Mid(Arr(i, 1), 8, 2) & "_" & 2
Arr(i, 1) = xD(T)
End If
If UCase(w1) = "R" Then
T = Mid(Arr(i, 1), 2, 4) & "/" & Mid(Arr(i, 1), 8, 2) & "_" & 1
Arr(i, 1) = xD(T)
End If
Else
T = Left(Arr(i, 1), 4) & "_" & 3
Arr(i, 1) = xD(T)
End If
Next
Range("b5").Resize(UBound(Arr)) = Arr
End Sub |
|