如何表达“如果值不为空”在VBA语言中? [英] How do I express "if value is not empty" in the VBA language?

查看:1018
本文介绍了如何表达“如果值不为空”在VBA语言中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在VBA语言中表达条件如果值不为空?是这样吗?

How do I express the condition "if value is not empty" in the VBA language? Is it something like this?

"if value is not empty then..."
Edit/Delete Message


推荐答案

使用 Not IsEmpty() / code>。

Use Not IsEmpty().

例如:

Sub DoStuffIfNotEmpty()
    If Not IsEmpty(ActiveCell.Value) Then
        MsgBox "I'm not empty!"
    End If
End Sub

这篇关于如何表达“如果值不为空”在VBA语言中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆