Thread: Type Mismatch
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Type Mismatch

Worked great, thanks Norman

"Norman Jones" wrote:

Hi Mike,

Try;

'=============
Public Sub Tester003()
Dim myItem As Long

If Range("n1").Value < "" And _
Application.CountA(Range("n2:n50")) = 0 Then myItem = 1
MsgBox myItem

End Sub
'<<============

BTW, I changed Item to myItem because Item ia a reserved word.


---
Regards,
Norman



"Mike" wrote in message
...
I receive a 'type mismatch' when trying to use the following line of code
to
check the contents of cells and then assign a constant to the variable
'item'.


If Range("n1").Value < "" And Range("n2:n50").Value = "" Then item = 1