choubix
06-20-2008, 09:23 PM
hello,
I am trying to get the number of week days between two date.
it seems I am using application.networkdays wrongly.
can someone tell me what's wrong with this tiny bit of code please?
Call Constants
Dim Start_Date As Variant, End_Date As Variant
Dim Total_Days As Double
Dim i As Integer
Set Start_Date = wsRC_Simple.Cells(19, 1)
Set End_Date = wsRC_Simple.Cells(19, 2)
'Set objexcel = CreateObject("Excel.Application")
Total_Days = Application.networkdays(Start_Date, End_Date)
For i = 1 To Total_Days
wsOutput.Cells(i, 1) = i
Next
I am trying to get the number of week days between two date.
it seems I am using application.networkdays wrongly.
can someone tell me what's wrong with this tiny bit of code please?
Call Constants
Dim Start_Date As Variant, End_Date As Variant
Dim Total_Days As Double
Dim i As Integer
Set Start_Date = wsRC_Simple.Cells(19, 1)
Set End_Date = wsRC_Simple.Cells(19, 2)
'Set objexcel = CreateObject("Excel.Application")
Total_Days = Application.networkdays(Start_Date, End_Date)
For i = 1 To Total_Days
wsOutput.Cells(i, 1) = i
Next