View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
duane[_21_] duane[_21_] is offline
external usenet poster
 
Posts: 1
Default If-Then-Else resulting in DIV/0 error


try this

If QualifiedEmployees = 0 Then AverageSalary = 0

else averagesalary= whateveryouwant - you need to define this
If QualifiedEmployees = 0 then
MsgBox "There are no employees who meet all of the criteria. _
Please rerun the macro."
Else
MsgBox "Macros are made more powerful by adding _
VBA statements."
End If

end su

--
duan
-----------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...fo&userid=1162
View this thread: http://www.excelforum.com/showthread.php?threadid=26789