Code
My code replaces Corporation to Corp and Incorporated to Inc. but what i need is, i want to identify which value is replacing, so i want that replacing value in Column B. that is Corporation in B2 and Incorporated in B3. My input and replacing list may go upto 10000 rows. attached sample file for reference.
Sub RemoveSpecialWithSpace()
Dim Rng As Range
Dim InputRng As Range, ReplaceRng As Range
Set InputRng = Sheets("Original Range").Range("A1", Sheets("Original Range").Range("A" & Rows.Count).End(xlUp))
Set ReplaceRng = Sheets("Replace Range").Range("A1:B4")
For Each Rng In ReplaceRng.Columns(1).Cells
InputRng.Replace what:=Rng.Value, replacement:=Rng.Offset(0, 1).Value
Next
End Sub
Display More
Input (Sheet 1 Column A) | Find (sheet 2 Column A) | Replace With ((sheet 2 Column B) | Output |
ABC Corporation | Corporation | Corp | ABC Corp |
ABC Incorporated | Incorporated | Inc | ABC Inc |