Assigning Variable Range

J

JMay

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
 
J

JMay

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top