View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Altering macro code

M5 in R1C1 reference style is R5C13

So just change the 2's that should always point to M5 to R5C13.

R5C13 is like $M$5 in A1 reference style.


cliff18 wrote:

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


--

Dave Peterson