Average Joe
New Member
- Joined
- Jul 20, 2012
- Messages
- 15
Hi,
Does anybody have any suggestions / alternatives to modify the below code to allow find and replace multiple values on all worksheets?
Also, if there is a way to fix replacing range, rather than having to select it each time?
Thanks
Does anybody have any suggestions / alternatives to modify the below code to allow find and replace multiple values on all worksheets?
Also, if there is a way to fix replacing range, rather than having to select it each time?
Thanks
Code:
Sub MultiFindNReplaceNew()
Dim Rng As Range
Dim InputRng As Range, ReplaceRng As Range
xTitleId = "Test"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Original Range ", xTitleId, InputRng.Address, Type:=8)
Set ReplaceRng = Application.InputBox("Replace Range :", xTitleId, Type:=8)
Application.ScreenUpdating = False
For Each Rng In ReplaceRng.Columns(1).Cells
InputRng.Replace what:=Rng.Value, replacement:=Rng.Offset(0, 1).Value
Next
Application.ScreenUpdating = True
End Sub