I have the following code
TextBox50.Value = Round((CDbl(TextBox3.Value) / (CDbl(Worksheets("calculation").Range("O4").Value)) - 1) * 100, 1) & "%"
The value of TextBox3 = Value
present in Worksheets("calculation").Range("O4")
.
The issue is if the value of Range(O4) is zero, then it essentially means 0/0 which is why I am getting runtime 6, overflow error.
Is there anyway I can replace 0/0 with 0.
Any help is much appreciated. Thank you
Something like this should work for situation where you have a divide by zero issue:
You can use IIF():
Which will return the value in TextBox3 if the other is 0.