Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and replace a character in a cell with another cell's content
Hello, I have several strings of characters in column "A" and, a list of
special characters in column "B" and a list of replacement characters in column "C". I would like to create a macro that copies B1 content, then look for it in all column "A" cells and replace it with C1 content, then will copy B2 content, look for it in column "A" and replace it with C2 content...and so on until next cell in "B" column is blank. I tried an iterative function, but it is not working as I expected. any and all help would be highly appreciated! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find and replace a character in a cell with another cell's content
Try the below which will replace cell contents...referring to ColB/C..
Please note that the replacement is for entire cell contents and not characters within the cell... Sub FindandReplaceComplexMultiples() Dim intTemp As Integer, arrFindReplace As Variant arrFindReplace = ActiveSheet.Range("B1:C" & _ ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row) For intTemp = 1 To UBound(arrFindReplace) If Trim(arrFindReplace(intTemp, 1)) < "" Then Columns(1).Replace What:=arrFindReplace(intTemp, 1), _ Replacement:=arrFindReplace(intTemp, 2), _ LookAt:=xlWhole, SearchOrder:=xlByRows End If Next End Sub If this post helps click Yes --------------- Jacob Skaria "JABAgdl" wrote: Hello, I have several strings of characters in column "A" and, a list of special characters in column "B" and a list of replacement characters in column "C". I would like to create a macro that copies B1 content, then look for it in all column "A" cells and replace it with C1 content, then will copy B2 content, look for it in column "A" and replace it with C2 content...and so on until next cell in "B" column is blank. I tried an iterative function, but it is not working as I expected. any and all help would be highly appreciated! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find a cell's content in another cell but only as whole word(s) | Excel Worksheet Functions | |||
how to find and replace content of a specific cell based on its ad | Excel Discussion (Misc queries) | |||
How to Find/Replace * (asterisk) in cell content | Excel Discussion (Misc queries) | |||
find replace the 1st character in a cell | Excel Discussion (Misc queries) | |||
how do i find and replace a portion of a cell's formula? | Excel Discussion (Misc queries) |