Excel find and replace not working

albertc30

Well-known Member
Joined
May 7, 2012
Messages
1,091
Office Version
  1. 2019
Platform
  1. Windows
Morning to everyone.

Hope you all had a good weekend.

I have this question for quite sometime now and it's puzzling me.

Whenever I need to search in the formulas to replace say Mon for Tue, excel displays cannot find any data to replace.

It will only work now if I close excel and do it again, then it works flawlessly.

has this happened to anyone before? Is this an excel glitch?

Thank you.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
On the options button of the replace dialog box do you have 'match entire cell contents' ticked?
 
Upvote 0
Something to play with, bit busy so not much to time to help fully sorry, try this on some test data in case and see what you think, edit as required

jiuk
Rich (BB code):
Option Explicit
'// jiuk

Sub Change_SOMETHING_IN_A_Formula()
'// jiuk - written by: Jack in the UK
'// for MrExcel.com | Excel Resources | Excel Seminars | Excel Products
'// feed /forum/excel-questions/802461-excel-find-replace-not-working.html
'// 01 - Sept - 2014

Dim myORIGINAL_TEXT As String
Dim myREPLACEMENT_TEXT As String

myORIGINAL_TEXT = "Mon"
' jiuk -Mon / Monday works on both
myREPLACEMENT_TEXT = "Tue"

On Error Resume Next
Selection.SpecialCells(xlCellTypeFormulas).Replace _
            What:=myORIGINAL_TEXT, _
            Replacement:=myREPLACEMENT_TEXT, _
            LookAt:=xlPart, _
            SearchOrder:=xlByRows, _
            MatchCase:=False

'// jiuk Trap Error (if nothing found)
If Err.Number <> 0 Then
   ' MsgBox "No data found"
   GoTo myERROR_ZERO
End If

theEND_Change_SOMETHING_IN_A_Formula:
On Error GoTo 0
'// jiuk - do something else / or NOT
Exit Sub

myERROR_ZERO:
MsgBox "JIUK _ Nothing to replace"
Exit Sub
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

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