View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
VegasPines VegasPines is offline
external usenet poster
 
Posts: 2
Default Relative references in formulas

I am aware of the basic usage of relative references in establishing a
formula. For example to sum a column of cells relative to a given cell the
following can be used:
ActiveCell.FormulaR1C1="=sum(R[-5]C[-2]:R[-1]C[-2])"
However, since the formula is a string, it is not possible to replace, for
instance, -5 with a variable. Is there a straightforward way to do this?