title: VBA: DateDiff does not return exact working days
body: <p>my general manager asked me to track the working days of our company's current projects that is recorded in an excel file and he wanted to me to make a new column for the remaining working days. I tried to make below code a function from the net to get the range of the days:</p>
  
  <pre><code>Function RDays(pDate1 As Date, pDate2 As Date) As Long
      RDays = DateDiff("d", pDate1, pDate2)
  End Function
  </code></pre>
  
  <p>but the results that i only get a value of 31 as a maximum days and when the value is greater than 31, the value returns to 1.. </p>
  
  <p>What would be the problem of this code? </p>