如何表达“如果值不为空”在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