Sub hi() Dim rng As Range For Each rng In ActiveSheet.UsedRange If IsNumeric(rng.Value) And Left(rng.Text, 1) = "#" Then MsgBox "Column too narrow for " & rng.Address End If Next rng End Sub
注意rng.text的用法!是单元格的显示内容,而不是单元格实际的值!