或以VBA刷公式:
Sub TEST()
Dim R&
R = Cells(Rows.Count, 1).End(xlUp).Row
If R < 3 Then Exit Sub
With Range("B3:B" & R)
.Formula = "=MID(A3,2+COUNT(-LEFT(A3,2)),1)"
.Value = .Value
End With
End Sub
將原編號〔月份〕為個位數的加〔前導0〕:
Sub TEST2()
Dim R&, Arr, i&
R = Cells(Rows.Count, 1).End(xlUp).Row
If R < 3 Then Exit Sub
With Range("A3:A" & R)
Arr = .Cells
For i = 1 To UBound(Arr)
If Not IsNumeric(Left(Arr(i, 1), 2)) Then Arr(i, 1) = 0 & Arr(i, 1)
Next i
.Cells = Arr
End With
End Sub作者: starry1314 時間: 2015-9-8 12:44