Hi, I have some VBA code that loops through column D and uses the values in range B:X. My problem is that sometimes, the value in some of the cells will have the error #DIVISION/0!. This stops my loop and creates an error. My solution to this was to put the below code before rendering the rest of the VBA code. This replaces #DIVISION/0! with a zero. But the code don't work! It is recorded from when I did it manually and when doing it manually everything works great. But when I run the Macro, the #DIVISION/0! is not replaced.
Anyone have an idea of what to do and why it don't work?
Here is the code I recorded:
Anyone have an idea of what to do and why it don't work?
Here is the code I recorded:
Code:
Columns("B:X").Select
Selection.Replace What:="#DIVISION/0!", Replacement:="0", LookAt:=xlPart _
, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False