View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jfcby[_2_] jfcby[_2_] is offline
external usenet poster
 
Posts: 121
Default Error Checking Code, Excel 2000 & 2003

Hello,

Adding to the previous information I began some code but it does not
check B8,D8,E8 to see if it is blank or has data then move to next row
B9,D9,E9 and if B9,D9 has data and E9 has no data then I need message
box to say "ERROR Type is blank"

Sub ErrorCheckTEST()
Dim Cell As Range
If Range("B8,D8,E8") = "" Then
If Range("B8") = "" Then
MsgBox "ERROR Date is empty"
If Range("D8") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E8") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

If Range("B9,D9,E9") = "" Then
If Range("B9") = "" Then
MsgBox "ERROR Date is empty"
If Range("D9") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E9") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

If Range("B10,D10,E10") = "" Then
If Range("B10") = "" Then
MsgBox "ERROR Date is empty"
If Range("D10") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E10") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

If Range("B11,D11,E11") = "" Then
If Range("B11") = "" Then
MsgBox "ERROR Date is empty"
If Range("D11") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E11") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

If Range("B12,D12,E12") = "" Then
If Range("B12") = "" Then
MsgBox "ERROR Date is empty"
If Range("D12") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E12") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

If Range("B13,D13,E13") = "" Then
If Range("B13") = "" Then
MsgBox "ERROR Date is empty"
If Range("D13") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E13") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

If Range("B14,D14,E14") = "" Then
If Range("B14") = "" Then
MsgBox "ERROR Date is empty"
If Range("D14") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E14") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

If Range("B15,D15,E15") = "" Then
If Range("B15") = "" Then
MsgBox "ERROR Date is empty"
If Range("D15") = "" Then
MsgBox "ERROR Description is empty!"
If Range("E15") = "" Then
MsgBox "ERROR Type is empty!"
End If
End If
End If
End If

End Sub

Thank you for your help,
jfcby

jfcby wrote:
Hello,

My worksheet range B8,D8,E8 through B15,D15,E15 has data like so;

DATE DESCRIPTION TYPE
1/1/2006 Got It! H
1/2/2006 Successful! WH
1/3/2006 Unlimited Possibilities O

I'm need a error checking code if B8,D8,E8 has data then it will check
B9,D9,E9 through B15,D15,E15. But, if B9 does not have data and D9,E9
does have data then it will give MsgBox "ERROR Date is empty". If D9 is
empty but B9,E9 has data then it will give MsgBox "ERROR Description is
empty!". If E9 is empty but B9,D9 has data then it will give MsgBox
"ERROR Type is empty!". Then it highlights the cell color light grey so
the user will know which cell needs data.

Thank you for your help in advance,
jfcby