|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
i = 2
Cells(1, 3) = Cells(2, 7)
ls11 = Cells(1, 3)
Do While True
str1 = Cells(i, 2)
If Len(str1) = 0 Then Exit Do
str1 = Left(str1, 18)
strls1 = " "
ls3 = 0
For j = 2 To 6
ls1 = Mid(str1, (j - 1) * 3 - 2, 2)
ls2 = Mid(str1, j * 3 - 2, 2)
If ls2 - ls1 = 1 Then
If ls3 = 0 Then
strls1 = strls1 & Format(ls1, "00") & " " & Format(ls2, "00") & " "
Else
strls1 = strls1 & Format(ls2, "00") & " "
End If
ls3 = ls3 + 1
Else
ls3 = 0
End If
Next j
Cells(i, 3) = strls1
Cells(i, 4) = Len(strls1) / 3
i = i + 1
Loop
Range("J1").Select
ActiveWorkbook.Save
End Sub
为什么会出现“类型不匹配”,怎么改?
|
|