单元格太窄的#号

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的用法!是单元格的显示内容,而不是单元格实际的值!

posted @ 2012-04-17 22:04  ibg  阅读(197)  评论(0编辑  收藏  举报