title: macro to copy formula down if adjacent cell not blank
body: <p>Okay folks, I have this simple table below and I am trying to calculate a macro vba formula in column G as long as column c has a value. All the info in the spreadsheet is already pulled in from a previous macro.  Here is what I have....</p>
  <p><img src="https://i.stack.imgur.com/q16ix.png" alt="1" /></p>
  <pre><code>Sub Macro1()
  '
  ' Macro1 Macro
  '
      
      Dim x As Long
      
      x = CLng((d2 + e2) / c2)
      
      
      For Each r In Intersect(ActiveSheet.UsedRange, Range(&quot;C:C&quot;))
          If r.Value &lt;&gt; &quot;&quot; Then
           r.Offset(1, 5).Value = x
      
          End If
      Next r
  
      
  End Sub
  </code></pre>