Thread: Testing a cell
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
lars kofod lars kofod is offline
external usenet poster
 
Posts: 17
Default Testing a cell

Does this work??

Private Sub Worksheet_SelectionChange(ByVal Target As
Range)
If Not Application.Intersect(Target, Range("B1:B20")) Is
Nothing Then
Select Case Target
Case IsEmpty("Target"): [D1] = "Empty"
Case Not IsEmpty("Target"): [D2] = "Full"
End Select
End If
End Sub

-----Original Message-----
Hello group,

I am trying to detect if a cell is blank.
The Empty case always triggers correctly
but never the Full case when a cell has something in it.

Private Sub Worksheet_SelectionChange(ByVal Target As

Range)
If Not Application.Intersect(Target, Range("B1:B20")) Is

Nothing Then
Select Case Target
Case IsEmpty("Target"): [D1] = "Empty"
Case Len("Target") 0: [D2] = "Full"
End Select
End If
End Sub

Any insight ?

Thanks,

Michael Singmin


.