0
Selection.FormulaR1C1 = "=IF(RC[-1-" & NofRanks & "]>R4C3,RC[-4-" & NofRanks & "]/R2C3,0)"

Hi guys i am getting Syntax Error, can anyone please help.?

NofRanks- is a variable integer.

braX
  • 11,506
  • 5
  • 20
  • 33
  • Please, write the formula as you like it to be in a cell. – FaneDuru Nov 27 '21 at 20:55
  • =IF(C32>$C$24,D32/$C$22,0) – Mystical Devices Nov 27 '21 at 20:57
  • Please, do it in similar formula types. Or show us `FormulaR1C1` as you like it to be, or try using `Formula` in your question. Not knowing in which cell is `Selection`, it is difficult to make such a conversion. – FaneDuru Nov 27 '21 at 21:28
  • Suggest: Provide some examples (at least 3) of `NofRanks` values, together with the cells (e.g. in the form `E32`) into which the resultant `Formula` will be written, and what the `Formula` would be in each case. And please do that in your question (not here in comments). Otherwise, you're asking us to do a lot a unnecessary work trying to guess what you really want. – Spinner Nov 27 '21 at 21:44
  • try `Selection.FormulaR1C1 = "=IF(RC[" & -(1 + NofRanks) & "]>R4C3,RC[" & -(4 + NofRanks) & "]/R2C3,0)"` – CDP1802 Nov 27 '21 at 23:20

0 Answers0