Hi Folks,
I'm hoping someone can help me, I've searched this forum, but haven't been able to find anything that matches what I'm trying to do.
My VB skills are limited, but I'm trying to improve them.
I need to write code that identifies the last working day of the current month and then once that is identified print a report.
This is what I have put together so far:
START CODE:
Dim CurDate
Dim MyWeekDay
Dim DayOfWeek
Dim EndOfMonth
CurDate = Format(Now(), "dd/mm/yy")
MyWeekDay = Weekday(CurDate)
If MyWeekDay = 1 Then
DayOfWeek = "Sunday"
End If
If MyWeekDay = 2 Then
DayOfWeek = "Monday"
End If
If MyWeekDay = 3 Then
DayOfWeek = "Tueday"
End If
If MyWeekDay = 4 Then
DayOfWeek = "Wednesday"
End If
If MyWeekDay = 5 Then
DayOfWeek = "Thursday"
End If
If MyWeekDay = 6 Then
DayOfWeek = "Friday"
End If
If MyWeekDay = 7 Then
DayOfWeek = "Saturday"
End If
END CODE
What I have not been able to work out is how to identify the last working day of the current month!
Any assistance would be most appreciated.
John
I'm hoping someone can help me, I've searched this forum, but haven't been able to find anything that matches what I'm trying to do.
My VB skills are limited, but I'm trying to improve them.
I need to write code that identifies the last working day of the current month and then once that is identified print a report.
This is what I have put together so far:
START CODE:
Dim CurDate
Dim MyWeekDay
Dim DayOfWeek
Dim EndOfMonth
CurDate = Format(Now(), "dd/mm/yy")
MyWeekDay = Weekday(CurDate)
If MyWeekDay = 1 Then
DayOfWeek = "Sunday"
End If
If MyWeekDay = 2 Then
DayOfWeek = "Monday"
End If
If MyWeekDay = 3 Then
DayOfWeek = "Tueday"
End If
If MyWeekDay = 4 Then
DayOfWeek = "Wednesday"
End If
If MyWeekDay = 5 Then
DayOfWeek = "Thursday"
End If
If MyWeekDay = 6 Then
DayOfWeek = "Friday"
End If
If MyWeekDay = 7 Then
DayOfWeek = "Saturday"
End If
END CODE
What I have not been able to work out is how to identify the last working day of the current month!
Any assistance would be most appreciated.
John