View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default If Len 5 OR cell is alphanumeric Then Clear contents

For Each cell In ACtivesheet.UsedRange
If Len(cell.Value) < 5 Or _
Not (IsNumeric(cell.Value) Then
cell.ClearContents
End If
Next cell

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ps.com...
Hi there

I've got a macro that doeas a whole load of formatting for me, I'm just
after a final statement that'll look at all the cells in the active
worksheet and clears the contents of the cell if the length is less
than 5 OR there are alphabetic characters mixed with the numbers.

Thanks