Guys
I have the following formula in a cell
=NETWORKDAYS(A2,B2)-(MOD(A2,1)>=MOD(B2,1))
its works off of cells A2 for the start date and cell B2 for the end date and works perfect
I want to use this in code to automatically count business days for all rows. I have tried the following
Dim ressfp,a4,a5
a4 = Worksheets("Master").Range("O" & b).Value 'target comp date
a5 = Worksheets("Master").Range("P" & b).Value 'actual comp date
ressfp =NETWORKDAYS(a4,a5)-(MOD(a4,1)>=MOD(a5,1))
I get an error on the word MOD saying compile error syntax error but cant work out why
i have tried replacing the networkdays formula with the following
=SUM(INT((WEEKDAY(A2-{2,3,4,5,6})+INT(B2)-INT(A2))/7))-(MOD(A2,1)>MOD(B2,1))
but this gives the error that the curly brackets are invalid characters
Any ideas where im going wrong?
Mark
I have the following formula in a cell
=NETWORKDAYS(A2,B2)-(MOD(A2,1)>=MOD(B2,1))
its works off of cells A2 for the start date and cell B2 for the end date and works perfect
I want to use this in code to automatically count business days for all rows. I have tried the following
Dim ressfp,a4,a5
a4 = Worksheets("Master").Range("O" & b).Value 'target comp date
a5 = Worksheets("Master").Range("P" & b).Value 'actual comp date
ressfp =NETWORKDAYS(a4,a5)-(MOD(a4,1)>=MOD(a5,1))
I get an error on the word MOD saying compile error syntax error but cant work out why
i have tried replacing the networkdays formula with the following
=SUM(INT((WEEKDAY(A2-{2,3,4,5,6})+INT(B2)-INT(A2))/7))-(MOD(A2,1)>MOD(B2,1))
but this gives the error that the curly brackets are invalid characters
Any ideas where im going wrong?
Mark