espenskeie
Well-known Member
- Joined
- Mar 30, 2009
- Messages
- 636
- Office Version
-
- 2016
- Platform
-
- Windows
Hi
I have a code that will divide some cellvalues, but sometimes the cells are either empty or has an zero.
How can I prevent the code from stopping?
Kind regards
Espen
I have a code that will divide some cellvalues, but sometimes the cells are either empty or has an zero.
How can I prevent the code from stopping?
Code:
If Not IsError(.Range("L" & j).Value * .Range("N" & j).Value) / -(.Range("M" & j).Value * .Range("O" & j).Value) Then
.Range("Q" & j).Value = (.Range("L" & j).Value * .Range("N" & j).Value) / -(.Range("M" & j).Value * .Range("O" & j).Value)
End If
Kind regards
Espen