PDA

View Full Version : Check Cell for Blank



doctortt
03-28-2011, 11:24 AM
Hi,

I just started learning VBA yesterday and don't have much knowledge. How do you write codes to check whether a cell is blank or not? If it does have a blank, it will throw out an error message.

nepotist
03-28-2011, 11:31 AM
If (IsEmpty(Cells(1, 2))) Then
MsgBox "1"
Else
MsgBox "2"
End If

doctortt
03-28-2011, 11:48 AM
Thanks appreciate it.

mdmackillop
03-28-2011, 12:01 PM
Or commonly
If Cells(1,1) = "" Then