0

我想找到值溢出其列宽的任何单元格。

查看单元格的属性,我可以看到单元格文本值为####,但 Excel 查找方法似乎不允许我搜索单元格值和单元格公式以外的任何内容。

4

1 回答 1

1

我终于明白了——

Set hashrange = .Cells.Find(What:="##", After:=.Cells(.Cells.Count), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)
If Not hashrange Is Nothing Then  
    hashrange.Columns.AutoFit
End If

这不是建议的重复帖子,我所追求的解决方案是在不迭代 vba 中的行或列的情况下查找溢出单元格的最快方法 - 这在大表中太慢(对我来说)。

希望有人觉得这很有用 - 现在在我的应用程序中使用它Excel 数据库任务

非常感谢您的所有回复。

于 2013-02-12T22:45:53.887 回答