MossJFoley
New Member
- Joined
- May 21, 2023
- Messages
- 1
- Office Version
- 365
- Platform
- Windows
Helo,
I have several exports from software which didn't tie information in together. So I have a list of parts that have all their descriptions, another that has all their dimensions and another that has their manufacturer. Only the list with the descriptions is complete.
I have used the mass replace by range below on previous projects but I want to modify it so that it matches the entire cell. Some of the parts listed are close and very few are the same length so part "1234" which is a diode gets confused with "1234-5" which is a "solenoid" and when I use the below code I get "diode-5"
Sub MutliFindNRepllaceNew()
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
I have several exports from software which didn't tie information in together. So I have a list of parts that have all their descriptions, another that has all their dimensions and another that has their manufacturer. Only the list with the descriptions is complete.
I have used the mass replace by range below on previous projects but I want to modify it so that it matches the entire cell. Some of the parts listed are close and very few are the same length so part "1234" which is a diode gets confused with "1234-5" which is a "solenoid" and when I use the below code I get "diode-5"
Sub MutliFindNRepllaceNew()
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