View Single Post
 
Old 01-29-2023, 07:26 AM
Marcia's Avatar
Marcia Marcia is offline Windows 11 Office 2021
Expert
 
Join Date: May 2018
Location: Philippines
Posts: 527
Marcia has a spectacular aura aboutMarcia has a spectacular aura aboutMarcia has a spectacular aura about
Default

Here's the code:
Code:
Sub blah()
With Application
  .ReplaceFormat.Clear
  .FindFormat.Clear
  .FindFormat.Interior.Color = RGB(220, 230, 241)
  .FindFormat.Locked = True
  .FindFormat.FormulaHidden = False
  .ReplaceFormat.Interior.Color = RGB(253, 233, 217)
  Cells.Replace What:="", Replacement:="", LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=True, ReplaceFormat:=True, FormulaVersion:=xlReplaceFormula2
  .ReplaceFormat.Clear
  .FindFormat.Clear
End With
End Sub
Thank you for the code p45cal and the screenshot of the Find/workbook setting. Had there been no picture, I wouldn't have understood your next instructions about "within worbkbook."
The code perfectly works in all the sheets except from some random cells that had not changed colors. I'm trying to find the cause of the different result.
Reply With Quote