ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba code for subtotals and percentages (https://www.excelbanter.com/excel-programming/315648-vba-code-subtotals-percentages.html)

pcscsr[_8_]

vba code for subtotals and percentages
 

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 .


--
pcscsr
------------------------------------------------------------------------
pcscsr's Profile: http://www.excelforum.com/member.php...o&userid=12006
View this thread: http://www.excelforum.com/showthread...hreadid=274838


Tom Ogilvy

vba code for subtotals and percentages
 
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.

--
Regards,
Tom Ogilvy


"pcscsr" wrote in message
...

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 .


--
pcscsr
------------------------------------------------------------------------
pcscsr's Profile:

http://www.excelforum.com/member.php...o&userid=12006
View this thread: http://www.excelforum.com/showthread...hreadid=274838





All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com