Dim count = 0
Dim totalDays = (DTLeavePayTo.Value - DTLeavePayFrom.Value).Days
Dim startDate As Date
For i = 0 To totalDays
Dim weekday As DayOfWeek = startDate.AddDays(i).DayOfWeek
If weekday <> DayOfWeek.Sunday Then
count += 1
End If
Next
Label1.Text = count