View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JMay JMay is offline
external usenet poster
 
Posts: 468
Default Assigning Variable Range

never mind, just tried the below, which worked..

ActiveCell.FormulaR1C1 = "=SUM(R[-" & rrow & "]C:R[-1]C)"

"JMay" wrote:

nrow = 8, so rrow = 5
but the below is not working -- What's wrong?

.... *** code **
nrow = Range("A65536").End(xlUp).Row + 1
rrow = nrow - 3
rrow = CInt(rrow)
Range("A" & nrow).Select
ActiveCell.FormulaR1C1 = "=SUM(R[-rrow]C:R[-1]C)" <<< PROBLEM
Range("A2").EntireRow.Delete
Range("A1").Select