1st Q -
have you tried something along these lines
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$K$28" Then
If Target > 6.75 Then
MsgBox "Value in " & Target.Address & " is > $6.75"
End If
End If
End Sub
BUT if K28 is cahnge via formula then you need
to use the worksheet caculate event eg
Private Sub Worksheet_Calculate()
If [K28] > 6.75 Then
MsgBox "Value in K28:= " & Format([K28], "$#.00") & " is > $6.75"
End If
End Sub
2nd Q-
Try using a formula eg.
=IF(OR(COUNTA(D5:D9)=0,COUNTA(D11:D26)=0),"Can't calculate! Data not complete",your formula here)
HTH
Ivan
Ivan,
the formula for question 1 worked great except for when I cleared the cells that k28 figured. I changed the formula to:
if [k28] is > 6.75 then
MsgBox "AHW is to high"
else
end if
I need for the formula to do nothing except for when/if k28 is greater than 6.75.
Cam
What is happening when you clear the cells
I'm assuming you are using the calculate event
ONLY....
Ivan
: Thanks very much. :
Ivan,
The cells that k28 figures are blank until someone enters the figures. At the start of each new week the cells need to be cleared for the new weeks numbers. While testing the formula I entered the numbers into the cells and k28 caculated them correctly and brought up the message, but when I cleared the cells of their content(like I was preparing for a new week) I got an error message(debug-if [k28] > 6.75 then, was highlighted). The formula works great when there are figures entered but if left blank I get the error after clearing them.
Cam What is happening when you clear the cells I'm assuming you are using the calculate event ONLY.... Ivan : Ivan, : the formula for question 1 worked great except for when I cleared the cells that k28 figured. I changed the formula to
What is the error
Plus what formula have you got in K28
I suspect that when cleared it is not a numerical
result and you could be getting a type mismatch ? Ivan, The cells that k28 figures are blank until someone enters the figures. At the start of each new week the cells need to be cleared for the new weeks numbers. While testing the formula I entered the numbers into the cells and k28 caculated them correctly and brought up the message, but when I cleared the cells of their content(like I was preparing for a new week) I got an error message(debug-if [k28] > 6.75 then, was highlighted). The formula works great when there are figures entered but if left blank I get the error after clearing them. : What is happening when you clear the cells : I'm assuming you are using the calculate event : ONLY.... : Ivan