Guys
Im trying to work out the exact business days for two dates
I have used the following code
Dim a5, a6, ressfp, b
For b = 2 To num_of_rows
a5 = Worksheets("Master").Range("O" & b).Value 'target comp date
a6 = Worksheets("Master").Range("P" & b).Value 'actual comp date
ressfp = Evaluate("NETWORKDAYS(" & a5 & "," & a6 & ")-(MOD(" & a5 & ",1)>=MOD(" & a6 & ",1))")
Next b
when run it crashes with the error "Type Mismatch"
when i hit debug and check the variables the following shows
a5= "08/07/2013 08:30:03"
a6= "23/07/2013 11:00:00"
ressfp="Error 2015"
I think its something to do with having the time there as well but that is needed as in this case the number of business days is 11 days 2 hours and 29 minutes and 57 seconds so the answer I need is "12"
Any Ideas?
Mark
Im trying to work out the exact business days for two dates
I have used the following code
Dim a5, a6, ressfp, b
For b = 2 To num_of_rows
a5 = Worksheets("Master").Range("O" & b).Value 'target comp date
a6 = Worksheets("Master").Range("P" & b).Value 'actual comp date
ressfp = Evaluate("NETWORKDAYS(" & a5 & "," & a6 & ")-(MOD(" & a5 & ",1)>=MOD(" & a6 & ",1))")
Next b
when run it crashes with the error "Type Mismatch"
when i hit debug and check the variables the following shows
a5= "08/07/2013 08:30:03"
a6= "23/07/2013 11:00:00"
ressfp="Error 2015"
I think its something to do with having the time there as well but that is needed as in this case the number of business days is 11 days 2 hours and 29 minutes and 57 seconds so the answer I need is "12"
Any Ideas?
Mark