PDA

View Full Version : does cellvalue have . and :?



Ago
03-08-2008, 02:09 PM
sometimes the data gets corupted and if i dont manually see it, it will end up in my sheet.
the only way i can think of to get the macro to do the check for me is to make a if-statement that asks if the cellvalue has three . (dots) and one :

how do i write such a statement? is it possible?

Bob Phillips
03-08-2008, 02:45 PM
This should catch them



For Each cell In ActiveSheet.UsedRange

If Len(cell.Value) - Len(Replace(cell.Value, ".", "")) = 3 And _
Len(cell.Value) - Len(Replace(cell.Value, ":", "")) = 1 Then

MsgBox cell.Address
End If
Next cell

Ago
03-09-2008, 04:39 AM
thank you!