Beginner VBA question

  • Thread starter Thread starter light
  • Start date Start date
L

light

Trying to rank the column on the left with this formula:

ActiveCell.FormulaR1C1
"=RANK(RC[-1],RC[-1]:selection.End(xlDown).Select,0)"

Can someone tell me how to write this properly
 
light,

One way:

With ActiveCell
Range(.Cells(1, 1), .Cells(1, 0).End(xlDown)(1, 2)).Formula = _
"=RANK(" & .Cells(1, 0).Address(False, False) & ", " & _
Range(.Cells(1, 0), .Cells(1, 0).End(xlDown)).Address & ")"
End With

HTH,
Bernie
MS Excel MVP
 

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