2,464
社区成员
发帖
与我相关
我的任务
分享
'你用我这段代码试试
Sub macro1()
Dim xSheet As Worksheet
Dim Index As Long
Set xSheet = ThisWorkbook.Worksheets(1)
Index = 1
While Len(xSheet.Range("$A$" & Index).Text) = 4
xSheet.Range("$b$" & Index).NumberFormat = "@"
xSheet.Range("$b$" & Index).Value = Left(xSheet.Range("$a$" & Index).Value, 2) & "-" & Right(xSheet.Range("$a$" & Index).Value, 2)
Index = Index + 1
Wend
End Sub