Forum Discussion
Greg Bonaparte
Jul 30, 2020Iron Contributor
MULTIPLY NEGATIVE NUMBERS
The following macro needs to be false if BD an BE are negative values. I'm not clear how to. The formula used in cell BF... is =(BD...)*(BE...) Sub BFSORT()
Application.Calculation = xlManual
...
mtarler
Jul 30, 2020Silver Contributor
Greg Bonaparte That macro appears to be a recording (i.e. you didn't write it) and has a lot of extra unnecessary things so it is very unclear to me what it is that you actually need. Furthermore you say it should be FALSE but it is a SUB not a FUNCTION so it doesn't have a value. Do you need is a macro/function that return will return FALSE if both those cells are negative or is there a particular cell on the sheet being set by the macro that should be FALSE in that case? And why don't you just use a formula on the sheet? For example is this supposed to be a part of the formula in BF? Should each cell in BF either have a value of BD*BE unless both are negative and then be FALSE? If so maybe this formula in BF would help:
=IF(OR(BD1>=0,BE1>=0),BD1*BE1,FALSE)