Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一个类似于 IsError 函数的函数,TRUE如果输入有问题则返回,FALSE否则返回:
TRUE
FALSE
我有两个范围rng1,rng2我想执行这个操作
rng1
rng2
IsError( rng1.value / rng2.value)
如果TRUE或一个范围包含字符串、为空rng1.value或rng2.valuerng2.value=0
rng1.value
rng2.value
rng2.value=0
是否有类似的功能或一些很好的方式来说明这些条件?还是我应该只做一个包含所有条件的 If 语句or?
or
你可以做这样的事情(未经测试,但它应该可以解决问题):
Function CheckError(rng1 As Range, rng2 As Range) As Boolean On Error GoTo FoundError Dim x As Integer x = rng1.Value / rng2.Value CheckError = False Exit Function FoundError: CheckError = True End Function