- Sub qcw()
- Application.ScreenUpdating = False
- Dim r, i, m
- r = Range("a65536").End(xlUp).Row
- For i = 3 To r
- If Len(Cells(i, 1)) <= 5 Then
- If Right(Cells(i, 1), 1) <> "z" Then
- m = 5 - Len(Cells(i, 1))
- Cells(i, 1) = String(m, "0") & Cells(i, 1) & "z"
- Else
- m = 6 - Len(Cells(i, 1))
- Cells(i, 1) = String(m, "0") & Cells(i, 1)
- End If
- End If
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码 |