Find and replace in Excel
Closed
NehruKhandrika
-
Updated on Nov 14, 2018 at 11:08 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Nov 15, 2018 at 12:04 PM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Nov 15, 2018 at 12:04 PM
Related:
- Find and replace in Excel
- Excel date format dd.mm.yyyy - Guide
- Screenshot in excel - Guide
- Number to words in excel - Guide
- How to enable vba in excel - Guide
- Transfer data from one excel worksheet to another automatically - Guide
1 reply
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
547
Nov 15, 2018 at 12:04 PM
Nov 15, 2018 at 12:04 PM
Hi Nehru,
Give the following code a try:
NOTE: The word "red" is also part of the word "predominantly". To prevent the "e" to be removed from the word "predominantly", place a space in front of the word "red" on sheet1. So "Red" becomes " Red". Keep this in mind with other short words you might have in your list.
Best regards,
Trowa
Give the following code a try:
Sub RunMe() For Each cell In Sheets("Sheet1").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row) Sheets("Sheet2").Columns(1).Replace What:=cell.Value, Replacement:=cell.Offset(0, 1).Value, LookAt:=xlPart Next cell End Sub
NOTE: The word "red" is also part of the word "predominantly". To prevent the "e" to be removed from the word "predominantly", place a space in front of the word "red" on sheet1. So "Red" becomes " Red". Keep this in mind with other short words you might have in your list.
Best regards,
Trowa