Wanting to be able to run a code that is similar to
With something that will replace the whole cell instead of just that word in the cell. So for example, If in the cell I have "ask how" (not including the quotations) and want to replace the whole cell with "How?" (not including the quotations), or a cell that has "but how" and replace the whole cell with How?. I would like the find and replace code to search for the word how and replace it with How?, but sometimes the cell might have extra words. Does that make sense?
VBA Code:
Sub MultiFindNReplace()
'Update 20140722
Dim Rng As Range
Dim InputRng As Range, ReplaceRng As Range
xTitleId = "KutoolsforExcel"
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
With something that will replace the whole cell instead of just that word in the cell. So for example, If in the cell I have "ask how" (not including the quotations) and want to replace the whole cell with "How?" (not including the quotations), or a cell that has "but how" and replace the whole cell with How?. I would like the find and replace code to search for the word how and replace it with How?, but sometimes the cell might have extra words. Does that make sense?