Home > Software engineering >  Help, how to write a multiple judgment in vba function
Help, how to write a multiple judgment in vba function

Time:11-07

As shown in figure,
Write a function to satisfy the two requirements: four column data input, 1. If the column b is greater than the d column and column a is greater than the b column, the output BUY
Column is greater than 2. If d b column and a column is less than c, then the output SELL. Don't meet the output HOLD the continuous change of BUY or SELL to HOLD,
Such as the output to "BUY, BUY, HOLD, HOLD, SELL", to translate into "BUY and HOLD, HOLD, HOLD the shell", BUY BUY will change HOLD until appear behind the SELL. SELL, too, such as "SELL, SELL HOLD SELL BUY" to translate into "SELL, HOLD, HOLD, HOLD, BUY".
I write my own function is like this:
But run out is # VALUE, can run out the first half, second half of the two loops have replaced continuous business operation there is an error, ask the great spirit show

  •  Tags:  
  • VBA