title: ranking data using vba
body: <p>i come to ask your help i need to rank data using vba i have a block of results in column D and i want to rank them in column E without skiping any value so i tried this vba code but it gives me only zeros in all the column then my computer becom slow untill i close the excel file  this is the vba code i am using if anyone can help me : </p>
  
  <pre><code>Sub Mactro5()
  LastRow = Range("D" &amp; Cells.Rows.Count).End(xlUp).Row
  Range("E2:E" &amp; LastRow).Formula = _
      "=IF(D2=" &amp; Chr(34) &amp; Chr(34) &amp; "," &amp; Chr(34) &amp; Chr(34) &amp; ",SUMPRODUCT((D$2:D$" &amp; LastRow &amp; "&gt;D2)/COUNTIF(D$2:D$" &amp; LastRow &amp; ",D$2:D$" &amp; LastRow &amp; "&amp;" &amp; Chr(34) &amp; Chr(34) &amp; "))+1)"
  End Sub 
  </code></pre>