Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using VBA, is it possible to search a range for a value in one cell and
replace with a value in another cell? I have tried using the Record Macro option and recorded the following (which, of course, does not work). Application.Goto Reference:="SearchArea" Cells.Replace What:=Range("R2C2"), Replacement:=Range("R2C3"), LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub How can I modify it to make it work? Any help is greatly appreciated. -- molinaram |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub rplc()
Cells.Replace What:=Range("B2").Value, Replacement:=Range("C2").Value, LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub "molinaram" wrote: Using VBA, is it possible to search a range for a value in one cell and replace with a value in another cell? I have tried using the Record Macro option and recorded the following (which, of course, does not work). Application.Goto Reference:="SearchArea" Cells.Replace What:=Range("R2C2"), Replacement:=Range("R2C3"), LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub How can I modify it to make it work? Any help is greatly appreciated. -- molinaram |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you, Thank you, thank you. This is going to be such a time saver.
-- molinaram "JLGWhiz" wrote: Sub rplc() Cells.Replace What:=Range("B2").Value, Replacement:=Range("C2").Value, LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub "molinaram" wrote: Using VBA, is it possible to search a range for a value in one cell and replace with a value in another cell? I have tried using the Record Macro option and recorded the following (which, of course, does not work). Application.Goto Reference:="SearchArea" Cells.Replace What:=Range("R2C2"), Replacement:=Range("R2C3"), LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub How can I modify it to make it work? Any help is greatly appreciated. -- molinaram |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find and Replace - Replace with Blank Space | Excel Discussion (Misc queries) | |||
Find/Replace Event or Find/Replace for Protected Sheet ... | Excel Programming | |||
find and replace - replace data in rows to separated by commas | Excel Worksheet Functions | |||
Using Find and Replace to replace " in a macro | Excel Programming | |||
Replace method - cannot find any data to replace | Excel Programming |