I neee a rotuine that will be passed the number of months and needs to return a string var of the number of years and a string var of the number of months.
Thought this was going to be easy but rounding is getting in the way. On a numbe of months like 23 I am getting 2 year -1 months.
Here's what I have so far, which doesn't work.
Public Sub convertNumMonthsToYearsandMonths(passedNumberOfMonths As Long, _
returnYearStr As String, _
returnMonthsStr As String)
Dim wkYears As Double
Dim wkYearsInt As Long
Dim wkMonths As Long
If passedNumberOfMonths < 12 Then
wkYears = 0
wkYears = Round(passedNumberOfMonths / 12, 2)
wkYearsInt = CInt(wkYears)
wkMonths = passedNumberOfMonths - (wkYearsInt * 12)
returnYearStr = Trim(Str(wkYearsInt))
returnMonthsStr = Trim(Str(wkMonths))
Hwo can I get this to work?