Visual Basic Show MonthEnd
Version Compatibility : Visual Basic 6.0 SP6
More information : Creating a MonthEnd in Visaul Basic is not simple. You can use function
DateSerial,Year,Month,Day and You can Create is Public Function Or Private Funcation :
' Source Code Visaul Basic
Public Function MonthEnd(ByVal pDate As Variant) As Variant
On Error GoTo MonthEnd_Err
MonthEnd = (DateSerial(Year(pDate), Month(pDate), 28) + 4) - Day((DateSerial(Year(pDate), Month(pDate), 28) + 4))
MonthEnd_Exit:
Exit Function
MonthEnd_Err:
MonthEnd = (DateSerial(Year(Now), Month(Now), 28) + 4) - Day((DateSerial(Year(Now), Month(Now), 28) + 4))
Resume MonthEnd_Exit
End Function
You can creat source code in form name or copy source code to the module and cell function MonthEnd.
Example use:
' in source code form name
Call MonthEnd(Current Date)
*** if you question you can use comment please.
0 Comment:
Post a Comment