Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub ErrorCheckTEST()
Dim i as Long Dim cell as Range, cell1 as Range Dim rng as Range Dim msg(1 to 3) as String msg(1) = "ERROR Date is empty" msg(2) = "ERROR Description is empty" msg(3) = "ERROR Type is empty" for each cell in Range("B8:B15") set rng = cell.Range("A1,C1:D1") i = 1 for each cell1 in rng if cell1 = "" then cell1.Interior.ColorIndex = 15 msgbox msg(i) & ": " & cell.Address end if i = i + 1 Next cell1 Next cell End Sub -- Regards, Tom Ogilvy "jfcby" wrote in message ups.com... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code Error Message Excel 2000 - 2003 | Excel Programming | |||
Need Error Message Box In VBA Code - Excel 2000 & 2003 | Excel Programming | |||
Excel 2003 causes error with Excel 2000 VBA code | Excel Programming | |||
Error Checking Options - 2000-2003 | Excel Discussion (Misc queries) | |||
Error in Excel 2000, but not 2002 and 2003 | Excel Programming |