Replace Around Wilcards

smitpau

Board Regular
Joined
Apr 2, 2020
Messages
167
Office Version
  1. 365
Platform
  1. Windows
Hi,

Wonder if someone maybe able to help with this say I have the following names below.

If I search BS??BD it will find the two current results but if I try to keep the 3rd and 4th characters as 01,02 but update the Test for Final using BS??Final it will then insert the ??

Is there a way to essentially leave the searched wildcard values as they are?

PS appreciate you could search Test and replace with Final but in this case I need the specific search to avoid finding other non-relevant cells (like columns BD).


Current
BS01BD
BS02BD

Updated
BS01Final
BS02Final


Hope I've explained it clearly.

Thanks for reading
 
Sorry I couldn't help more & thanks for the feedback.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
To round this off, found the code listed below and linked below which bulk changes named ranges very well so avoids this problem in the first place.

VBA Code:
Sub NameChanger()
    Dim arNames()
    Dim nm As Name
    Dim i As Integer
    
    arNames = Sheets("Sheet2").Range("NameList").Value
    For i = LBound(arNames) To UBound(arNames)
        For Each nm In ActiveWorkbook.Names
            If nm.Name = arNames(i, 1) Then
                nm.Name = arNames(i, 2)
            End If
        Next nm
    Next i
End Sub


 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top