Hi All. I'm using this code to Find / Replace certain values in a group of cells:
The code works fine when the value is present, but If I run this and there isn't a 99 in any of the selected cells then it gives me an error saying "Microsoft Excel can not find any data to replace" and telling me to check the search criteria. Obviously the search criteria are fine, I just want it to not show an error message and move on to the next block of code.
Buuuut I'm not sure how to tell it to do this. Any help would be greatly appreciated.
Thanks!
Hank
Code:
Range("BG:BR" & LastRow).Select
Selection.Replace What:="99", Replacement:="0", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
The code works fine when the value is present, but If I run this and there isn't a 99 in any of the selected cells then it gives me an error saying "Microsoft Excel can not find any data to replace" and telling me to check the search criteria. Obviously the search criteria are fine, I just want it to not show an error message and move on to the next block of code.
Buuuut I'm not sure how to tell it to do this. Any help would be greatly appreciated.
Thanks!
Hank