R1C1 Quick Conversion Tool

indi visual

New Member
Normally, because I have no idea what I'm doing (lol), I record a macro and type in the formula. Once I view what the macro recorded I get the R1C1 version.

I need the R1C1 version of the following formulas:

[pre]&#60;br /&#62;
=COUNTIF(Z1,&#34;0&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;1&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;2&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;3&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;4&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;5&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;6&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;7&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;8&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;9&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;10&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;11&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;12&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;13&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;14&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;15&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;16&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;17&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;18&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;19&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;20&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;21&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;22&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;23&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;24&#34&#60;br /&#62;
=COUNTIF(Z1,&#34;25&#34&#60;br /&#62;
[/pre]

I tried what I normally do as mentioned above, but for one reason or another when I test the version the macro recorded, it doesn't translate quite right.

Any ideas on how to get this translated to R1C1?

Side note: Any translation help with the formulas above is appreciated, but I cannot have them condensed, they actually all have to remain separate for what I'm doing.

kchiba

Active Member
Hi,

The formula is not clear, are you Counting the items in one cell Z1 only, or are you trying to Count for the column.

To see what the R1C1 formula would be you can set Excel to R1C1 style in the Excel options for formulas. But be aware of the that R1C1 is usually a relative reference from the cell you working unless the reference in the formula is an absolute reference.

Let me know what you are trying to achieve with the formuls.

cheers

kanti

indi visual

New Member
I think I figured it out...

[pre]&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-37]C, &#34;&#34;0&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-38]C, &#34;&#34;1&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-39]C, &#34;&#34;2&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-40]C, &#34;&#34;3&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-41]C, &#34;&#34;4&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-42]C, &#34;&#34;5&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-43]C, &#34;&#34;6&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-44]C, &#34;&#34;7&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-45]C, &#34;&#34;8&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-46]C, &#34;&#34;9&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-47]C, &#34;&#34;10&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-48]C, &#34;&#34;11&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-49]C, &#34;&#34;12&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-50]C, &#34;&#34;13&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-51]C, &#34;&#34;14&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-52]C, &#34;&#34;15&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-53]C, &#34;&#34;16&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-54]C, &#34;&#34;17&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-55]C, &#34;&#34;18&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-56]C, &#34;&#34;19&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-57]C, &#34;&#34;20&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-58]C, &#34;&#34;21&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-59]C, &#34;&#34;22&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-60]C, &#34;&#34;23&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-61]C, &#34;&#34;24&#34;&#34&#34;&#60;br /&#62;
ActiveCell.FormulaR1C1 = &#34;=COUNTIF(R[-62]C, &#34;&#34;25&#34;&#34&#34;&#60;br /&#62;
[/pre]

I need to clear the contents of a cell, and then immediately pop it right back in. In order to do that, I needed the R1c1 formula for excel to place the formula back into the cell correctly.

I'm doing all of this for an audio alarm. The 0 through 25 you see are the different wave files it will play. However, I have to immediately pop the formula in and out or it won't shut up (it'll keep repeating forever or crash &#60;or both&#62.

Now, my page calculates automatically, and the alarm function only goes off once when the specified cell changes. It was a lot of work (and a lot of code for just an alarm function), and I have to wait 4 seconds each time the alarm goes off... but the pay off and professional feel was well worth it.

As for my original posted question.. my question was not clear (that and I didn't exactly know what I was asking for), so that wasn't your fault it was mine, and I definitely appreciate the help.