- ©«¤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
|
¦^´_ 1# PJChen
¬Ý§A쥻ªº¸ê®Æ¦n¹³¨S¦³»Ýn¸É"0" ªº¦a¤è?
Sub ¤ÀÂ÷³æ¸¹()
Dim Arr, R&
Arr = Range([E2], [E2].End(4))
If Arr(UBound(Arr), 1) = "" Then Exit Sub '¨S¸ê®Æ
Columns("R:T").NumberFormatLocal = "@"
ReDim Brr(1 To UBound(Arr), 1 To 3)
For R = 2 To UBound(Arr)
If Arr(R, 1) Like "*-*-*" Then
Brr(R, 1) = Split(Arr(R, 1), "-")(2)
Brr(R, 2) = Split(Arr(R, 1), "-")(1) & "-"
Brr(R, 3) = Split(Arr(R, 1), "-")(0) & "-"
If Len(Brr(R, 1)) < 3 Then Brr(R, 1) = String(3 - Len(Brr(R, 1)), "0") & Brr(R, 1)
If Len(Brr(R, 2)) < 5 Then Brr(R, 2) = String(5 - Len(Brr(R, 2)), "0") & Brr(R, 2)
If Len(Brr(R, 3)) < 4 Then Brr(R, 3) = String(4 - Len(Brr(R, 3)), "0") & Brr(R, 3)
End If
Next R
[R2].Resize(UBound(Brr), 3) = Brr
End Sub |
|