View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cliff18 cliff18 is offline
external usenet poster
 
Posts: 16
Default Altering macro code

I'm trying to alter part of a code given to me for running a macro by a
member but have had no luck seaching the help files or trial & error to get
it to work. The code works fine as it is, but I'd like to change the figure
"2" (which represents 50%) to cell "M5" which allows user input to adjust the
percentage.

So from: /2+RC[8] to: /M5+RC[8]

Working code below:

Sub ResRetr7()

Range("M7").FormulaR1C1 = _

"=IF(OR(AND(RC[5]=""H"",(RC[-9]<=((RC[7]-RC[8])/2+RC[8])))),""Yes"",IF(OR(AND(RC[5]=""I"",(RC[-9]=((RC[8]-RC[7])/2+RC[7])))),""Yes"",IF(OR(AND(RC[5]=""H"",(RC[-9]((RC[7]-RC[8])/2+RC[8])))),""Wait"",IF(OR(AND(RC[5]=""I"",(RC[-9]<((RC[8]-RC[7])/2+RC[7])))),""Wait"",""""))))"
End Sub

Thanks in advance.
--
Cheers
cliff18