title: How to provide range in Macro in Excel in below formula
body: <p>I have to create a formula where say 3 columns are present <code>A</code>, <code>B</code> &amp; <code>C</code> which has values till say serial 5. So now have to check If value in cell say <code>C1</code> is blank then cell <code>B1</code> would be <code>A1/Count(C)</code>. </p>
  
  <p>I am able to perform this for single cell but how can use below formula for range from <code>A1:A5</code>, <code>B1:B5</code> and <code>C1:C5</code></p>
  
  <pre><code>Sub CheckCnt()
  
  Range("C6") = WorksheetFunction.CountA(Range("C1:C5"))
  
  If Range("C1") = "" Then
      Range("B1") = WorksheetFunction.Round(Range("A1") / Range("C6"), 2)
  Else
  Range("B1") = 0
  
  End If
  End Sub
  </code></pre>