PDA

View Full Version : EXCEL DELETE



oleg_v
01-04-2010, 08:31 AM
Hi
I need some help with a macro

I need that macro will delete all cells in the column B that does not
contain word "dim"
the "dim" can be also a part of words

thanks

mbarron
01-04-2010, 08:53 AM
Assuming there are no blank rows until the end of your list and the list starts in row1
Sub NoDim()
Dim i As Long
Do Until Cells(i + 1, 2) = ""
If InStr(UCase(Cells(i + 1, 2)), "DIM") > 0 Then
Cells(i + 1, 2).ClearContents
End If
i = i + 1
Loop
End Sub