vba code for subtotals and percentages

  • Thread starter Thread starter pcscsr
  • Start date Start date
P

pcscsr

Tom,

The result I get when I do that is the following: it shows the
percentage and subtotal in column cin Column C instead of column D and
does not automatically do the math. I tried a combination of what you
said to do. do you have any other ideas?? Thank you .
 
Cells(n, 3).FormulaR1C1Local = "=.6*r[-1]d"

The 3 says to put he formula in column C. If you want column D, then change
3 to 4

=0.6*r[-1]d

I believe would be the way to manually do the formula in a German version of
Excel (I believe) - so it is my assumption that the formula notation you are
using is they way you would do it manually in your local version. So if you
use formulaR1C1Local, then using the formula as shown above should work. If
you want to use FormulaR1C1 instead, then you would change the d to a c

Cells(n, 3).FormulaR1C1 = "=.6*r[-1]c"

and not use FormulaR1C1Local (just use FormulaR1C1). This is how it would
be entered in an English version of excel and FormulaR1C1 expects English
syntax.

You should do one or the other - not both.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

labels for subtotals 1
Subtotal function 2
Subtotal Formatting 2
Column Subtotal Question 2
Subtotal by VBA 5
Subtotal percentage 1
Issue with nested data subtotals 3
subtotaling a column based on three others 3

Back
Top