ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Beginner VBA question (https://www.excelbanter.com/excel-programming/316267-beginner-vba-question.html)

light

Beginner VBA question
 

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

--
ligh
-----------------------------------------------------------------------
light's Profile: http://www.excelforum.com/member.php...nfo&userid=722
View this thread: http://www.excelforum.com/showthread.php?threadid=27687


Bernie Deitrick

Beginner VBA question
 
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

"light" wrote in message
...

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
------------------------------------------------------------------------
light's Profile:

http://www.excelforum.com/member.php...fo&userid=7228
View this thread: http://www.excelforum.com/showthread...hreadid=276870





All times are GMT +1. The time now is 05:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com