VBA判断Excel单元格的数据类型
- 2020-04-23 08:00:00
- zstmtony 原创
- 3557
VBA判断Excel单元格的数据类型
Public Function gf_CheckCellType(cel As Range) As String Dim strType As String Select Case True Case Application.IsText(cel) strType = "文本" Case Application.IsLogical(cel) strType = "逻辑值" Case IsEmpty(cel) strType = "空值" Case IsNumeric(cel) strType = "数值" Case Application.IsErr(cel) strType = "错误值" Case IsDate(cel) strType = "日期" End Select MsgBox "[" & cel.Address & "] 的数据类型为:" & strType gf_CheckCellType = strType End Function
文章分类
联系我们
联系人: | 王先生 |
---|---|
Email: | 18449932@qq.com |
QQ: | 18449932 |
微博: | officecn01 |