For a worksheet I would like to check the cells if they contain the
word "text".
Within a cell this word is always combined e.g.: text 06735
When the cell contains "text" I would like to clean the whole cell, so
text including e.g: 06735.
Result: a blank cell.
Please, can somebody help me out?
This can be done with a VBA Macro.
But before using this, be sure to:
1. Backup your data
2. Understand the "Find" method options in case the word you want to search
for is not "text"
To enter this Macro (Sub), <alt-F11> opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.
To use this Macro (Sub), <alt-F8> opens the macro dialog box. Select the macro
by name, and <RUN>.
===========================
Option Explicit
Sub ClearCellsContainingText()
Do Until Cells.Find(What:="text", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False) _
Is Nothing
Cells.FindNext.Clear
Loop
End Sub
==============================
--ron