ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using Two Variables in Excel Calculation VBA (https://www.excelbanter.com/excel-programming/373755-using-two-variables-excel-calculation-vba.html)

rita

Using Two Variables in Excel Calculation VBA
 
Having trouble getting correct syntax. Using two inputted variables
TotSalesDay and CurrSalesDay - need to calculate in cell

ActiveCell.FormulaR1C1 = "=RC[-2] / TotSalesDay * CurrSalesDay
--
Rita

Die_Another_Day

Using Two Variables in Excel Calculation VBA
 
ActiveCell.FormulaR1C1 = "=RC[-2] / " & TotSalesDay & " * " &
CurrSalesDay

HTH

Charles

Rita wrote:
Having trouble getting correct syntax. Using two inputted variables
TotSalesDay and CurrSalesDay - need to calculate in cell

ActiveCell.FormulaR1C1 = "=RC[-2] / TotSalesDay * CurrSalesDay
--
Rita




All times are GMT +1. The time now is 06:29 PM.

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