Delete cell content

C

Chuck Neal

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
 
G

Gary''s Student

Call this:

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

Bearacade

Sub ClearTran()
Cells.Replace What:="TRAN", Replacement:="", LookAt:=xlWhole
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False
ReplaceFormat:=False
End Su
 
C

Chuck Neal

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
 
Top