you make it look so simple - oneliner king
Here I'm mostly done with the payday radio button,
working on calculating odd even weeknumbers to know which friday is everyother friday.__frm Calendar snb_mod03.xlsm
Function WeekNum(DT As Date) As Long WeekNum = Int(((DT - DateSerial(Year(DT), 1, 0)) + 6) / 7) End Function Sub addPayDay_EoF() ' every friday 'makes every friday day captions Bold when the radio button is active Dim D, s, x As Integer Dim myDate As Date With ufCal For x = 1 To 42 .Controls("dnum" & x).Font.Bold = False Next x myDate = .uMonth.Caption & "-1-" & .uYear.Caption D = FirstWeekDayOfMonth(myDate) - 1 If (WeekNum(myDate) Mod 2) = 0 Then MsgBox ("EvenWeek") For s = 12 To 41 Step 14 .Controls("dnum" & s).Font.Bold = True Next s Else MsgBox ("OddWeek") For s = 6 To 41 Step 14 .Controls("dnum" & s).Font.Bold = True Next s End If End With End Sub




Reply With Quote