View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
[email protected] DavidCotton@austin.rr.com is offline
external usenet poster
 
Posts: 3
Default Divide by variable

Ok, maybe I am not googling correctly (and by no means am I a VBA
guru) but I need help with what seems like a very basic problem.. I
am trying to pass a variable into a formula and it is interpreting it
as text, not the variable value.. See below for relevent code...

DIM VAR1 as integer

ActiveCell.FormulaR1C1 = "=(RC[-31]+RC[-27])/VAR1

VAR1 is being incremented in a loop and I have verified it has a value
but instead of dividing by 3 for instance it is trying to divide by
VAR1.

Can someone hold my hand and let me know what rookie mistake I am
making???