Clear Contens in a Column except for

Dorian Grey 1 Reputation point
2020-11-24T00:27:49.173+00:00

Greetings, I am trying to insert text (Column E) in a cell if there is a number in another cell Column D. The problem is even for the blank cells "TBD" is being inserted in Column D. Now I'm trying to clear the contents of Column D, so excel doesn't think there is data there. This code will need to ignore the word "ROLL CALL" and any four digit number "####". Column D is in a Text format.
I did try this code, but got nowhere fast. Any suggestions would be great.

Sub DoNotContainrollcall()

Dim rng As Range
Dim cell As Range
Dim ContainWord As String

With Sheets("72 HR")
      With .Range("D2", .Range("D" & Rows.Count).End(xlUp))

  ContainWord = "ROLL CALL". "####"

  For Each cell In rng.Cells
    If cell.Find(ContainWord) Is Nothing Then cell.Clear
  Next cell
End With
End With
End Sub
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,205 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dorian Grey 1 Reputation point
    2020-11-24T04:18:10.207+00:00

    This has been solved, Thank you to whoever took the time to help me with this.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.