請問各位達人,小弟如果要判斷 某個範圍裡的值不等於空白
例如 A1:A4 無論其中哪個有值,只要顯示一次訊息就好
用FOR NEXT 的話如果4格都有值就會顯示4次,能只要顯示一次訊息就好嗎
sub dd()
Dim xR As Range
For Each xR In [a1:a4]
If xR <> "" Then
MsgBox "有值"
End If
Next
End Sub作者: 准提部林 時間: 2016-8-1 11:33
For Each xR In [a1:a4]
If xR <> "" Then
MsgBox "有值"
Exit For
End If
Next
可簡略:
For Each xR In [a1:a4]
If xR <> "" Then MsgBox "有值":Exit For
Next作者: feecshyrnd 時間: 2016-8-2 17:47