String类型转换为int类型的时候,提示类型不匹配
With Sheet1
k = .Range("a65536").End(xlUp).Row
'arr = .Range("a1:a" & k)
'程序开始
'o = 0
n = 0
For i = 1 To k
n = ActiveSheet.Cells(i, 10)
' If arr(i, 1), 10).value >0 and arr(i, 1), 10).value <10 And i > 0 Then
If n > 0 And n < 10 Then
m = ActiveSheet.Cells(n, Page_Colum).Value
If m = 1 Then
l = l + 1
str = " " & l
Else
l = l + 1
str = " " & l & "-"
l = l + m - 1
str = str + "" & l
End If
ActiveSheet.Cells(i, Page_Colum + 4).Value = str
'm = 0
str = ""
End If
Next
MsgBox "已经完成"
ActiveWorkbook.Save
End With
为什么在红色区域提示类型错误呢?之前也是这样用的,现在总是有问题
[解决办法]
上传你的测试文件以供别人分析调试。
QQ群 48866293 OFFICE应用挖掘
MS OFFICE(ACCESS\EXCE\WORD等应用技术探讨与交流!技术群,请阅群论坛中的《踢人规则》
[解决办法]
你可以用n = val(ActiveSheet.Cells(i, 10).Value)