vba 判断是否为数字


1.先设置单元格为 保留2位小数。

 

2.判断单元格内容

Dim line1 as single

Dim line2 as single

If Cells(2,2).Value = "" Then

  line1 = 0

Else 

  if Not IsNumeric(Cells(2, 2).Text) Then

    MsgBox "Input Data Error!"

  End if

  line1 = Cells(2,2).Value

End if

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM