Delete cell content

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I need to incorporate some code into my series of macros. I need to be able
to check the entire worksheet and if "TRAN" appears anywhere, I need to clear
the contents of that cell. Only the word TRAN, if it says TRANSLATE or some
other similar word, I need it to stay. Since it would be a part of the macro
series, filtering won't work because the data changes daily and I need it
fairly automated.

Thanks in advance,
Chuck
 
Sub ClearTran()
Cells.Replace What:="TRAN", Replacement:="", LookAt:=xlWhole
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False
ReplaceFormat:=False
End Su
 
That did it! Thanks so much!

Gary''s Student said:
Call this:

Sub gsnu()
Dim r As Range
For Each r In ActiveSheet.UsedRange
If r.Value = "TRAN" Then r.Clear
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top