Public Sub getMinPeriod_MaxPeriod_TotalInstallPlanPeriods(passedYearsGoverned As String, _ returnMinAgreementPeriod As Long, _ returnMaxAgreementPeriod As Long, _ returnNumberOfPeriods As Long, _ returnIs2017Included As Boolean) ' this routine will be passed the years governed string from the install plan ' the try to pick out the min year, max year and then calculate the number of periods. ' ' basically it will create the years one by one starting at 1960. Then it will see if that year ' exist in the string. If it does it will make that year eithere the oldest found so far or ' the newest found so far. At the end of looping thru the years we should have the min and max ' Dim wkYearStr As String Dim wkYearNum As Long Dim wkMinPeriod As Long Dim wkMaxperiod As Long ' wkMinPeriod = 9999 wkMaxperiod = 0 returnIs2017Included = False ' returnIs2017Included = False ' For wkYearNum = 1960 To 2017 ' wkYearStr = Trim(Str(wkYearNum)) If InStr(1, passedYearsGoverned, wkYearStr) Then ' compare min If wkYearNum < wkMinPeriod Then wkMinPeriod = wkYearNum End If ' compare max If wkYearNum > wkMaxperiod Then wkMaxperiod = wkYearNum End If ' is 2017 included If wkYearNum = 2017 Then returnIs2017Included = True End If ' End If ' Next wkYearNum ' ' If none found them all must be returned as zero ' If wkMinPeriod = 9999 Then wkMinPeriod = 0 End If ' ' calculate the number of periods ' returnMinAgreementPeriod = wkMinPeriod returnMaxAgreementPeriod = wkMaxperiod returnNumberOfPeriods = wkMaxperiod - wkMinPeriod + 1 ' End Sub
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: