View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Delete cells based on condition

Hi Terry,

Am Thu, 26 May 2016 20:58:45 +0100 schrieb Terry Pinnell:

https://dl.dropboxusercontent.com/u/...eSomeCells.jpg


try:

Sub Test()
Dim LRow As Long, i As Long

With ActiveSheet
LRow = .Cells(Rows.Count, 1).End(xlUp).Row
For i = 3 To LRow
If Len(.Cells(i, 2)) = 0 And _
Application.CountIf(Range("A3:A" & i), .Cells(i, 1)) 1
Then
.Cells(i, 1).ClearContents
End If
Next
End With
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional