Dim Days As Integer = Date.DaysInMonth(args(0),args(1)) Dim Count As Integer Dim Val As Date For i As integer = 1 To Days Val = New date(args(0),args(1),i) If Val.DayofWeek > 0 AndAlso Val.DayofWeek < 6 Then Count = Count + 1 End If Next return count