我的代码如下,给出错误的行,类型不匹配,运行时错误13是for循环中的行。为什么会发生这种情况,我该如何避免呢?
Workbooks(theFile).Worksheets(1).Columns("G:G").EntireColumn.NumberFormat = "0.00"
For Each myCell In Columns("G:G")
myCell.Value = WorksheetFunction.Trim(WorksheetFunction.Clean(myCell.Value))
Next
答案 0 :(得分:3)
可能类似
For Each myCell In Columns("A:A").Cells
myCell.Value = WorksheetFunction.Trim(myCell.Value)
Next