stackemedia

Get first day of current month (VB)

This was posted in Visual Basic on June 17th, 2009

The following code will return the first day in the month as a string.

=DATESERIAL( YEAR(TODAY()), MONTH(TODAY()),1 )

Get whether a given date is on a weekend or not (VB)

This was posted in Visual Basic on June 17th, 2009

Function returns false if the passed date is a weekend and true if the date is on a working day.

Function GetWeekDay(ByVal raisedDate As Date) As Boolean
Dim passedDayNumber As Integer
passedDayNumber = DatePart(“w”, raisedDate)
If passedDayNumber = 7 Or passedDayNumber = 1 Then
return false
Else
return true
End If
End Function

Tested browsers: firefox, chrome, IE8