How to get difference between current date and given date from cell in VBA?
<p>I am new in VBA. I want to get the difference between current date and given date from user. How can I solve this? <a href="https://i.stack.imgur.com/kdV95.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/kdV95.jpg" alt="enter image description here"></a>When I click the Calculate point Button it showed #NAME? </p>

<p>Here is my code:</p>

<pre><code>Private Sub Sum_Click()
Dim LastRow As Long

LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Range("F6:F" &amp; LastRow).Formula = "=DateDiff(""y"", Now, c6)"
End Sub
</code></pre>