Variable Range Reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The following code doesn't work with a Method Range of object Global failed
error

For b = 6 To 15
Set rng = Range(Cells(3, b))
rng.Select
Selection.FormulaArray = "=PERCENTILE(R52C4:R" & c & "C4,R2C" & b &
")"
Next

But if I hard code the destination cell i.e. Set rng = Range("f3") it will
work for that one cell. What am I doing wrong in naming this range? Any
help is greatly appreciated.

Also, is there an On Exit event for a cell?
 
Try:

For b = 6 to 15
Set rng = Cells(3,b)
rng.FormulaArray = "=PERCENTILE(R52C4:R" & c & "C4,R2C" & b & ")"
Next b

Ray at work
 

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

Back
Top