Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to remove only the TEXT is present in a cell using Excel VBA.

For Example

"REASON CODES"

need to remove the above value in a cell.
Can any one help me on the above one, that would be greatly appreciated.

Thanks in advance.
Posted

1 solution

VB
Sub Macro1()
    Cells.Replace What:="REASON CODES", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
End Sub


You may also use Macro Recorder to record a macro with your search parameters.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900