ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   why won't this work (https://www.excelbanter.com/excel-programming/438324-why-wont-work.html)

Zab

why won't this work
 
Sub Macro1()

total = [d65000].End(xlUp).Value
ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]"
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=RC[-1]/total"

End Sub

there are numerical values in columns A B & C, i run this macro when i am in
D.
--
Thank You in advance, Zab

JLGWhiz[_2_]

why won't this work
 
This line:

ActiveCell.FormulaR1C1 = "=RC[-1]/total"

Should be:

ActiveCell.FormulaR1C1 = "=RC[-1]/" & total

But unless you already have data in column D, you probably will not get the
results you expect.



"Zab" wrote in message
...
Sub Macro1()

total = [d65000].End(xlUp).Value
ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]"
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=RC[-1]/total"

End Sub

there are numerical values in columns A B & C, i run this macro when i am
in
D.
--
Thank You in advance, Zab




Zab

why won't this work
 
i will be able to use what you have given me
THANKS!!!
zab


"JLGWhiz" wrote:

This line:

ActiveCell.FormulaR1C1 = "=RC[-1]/total"

Should be:

ActiveCell.FormulaR1C1 = "=RC[-1]/" & total

But unless you already have data in column D, you probably will not get the
results you expect.



"Zab" wrote in message
...
Sub Macro1()

total = [d65000].End(xlUp).Value
ActiveCell.FormulaR1C1 = "=RC[-2]*RC[-1]"
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=RC[-1]/total"

End Sub

there are numerical values in columns A B & C, i run this macro when i am
in
D.
--
Thank You in advance, Zab



.



All times are GMT +1. The time now is 07:01 PM.

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