Hello,
I have a userform to track monthly bills.
I have radial buttons to make Bold the day of the week of pay day. 4 options:
Off, Fridays, Every other Friday and Bitmonthly (user input box one for each day)
The code works except every day becomes bold instead of just the 2 input values.
Not sure what I'm I have done wrong.
Any help is much appreciated.
This is the code for every other friday, works fineSub pd_BiMonth() ' bi monthly'makes the nD1 and nD2 text input entries day captions Bold when the check box is active Dim D, x As Integer Dim nD1 As Variant Dim nD2 As Variant Dim myDate As Date With ufCal nD1 = InputBox("Please enter the day of the month your first payday lands on", "First PayDay of Month") If nD1 = "" Then Exit Sub nD2 = InputBox("Please enter the day of the month your second payday lands on", "Second PayDay of Month") If nD2 = "" Then Exit Sub For x = 1 To 42 .Controls("dnum" & x).Font.Bold = False .Controls("dnum" & x).Font.Size = 9 Next x myDate = .uMonth.Caption & "-1-" & .uYear.Caption D = FirstWeekDayOfMonth(myDate) - 1 .Controls("dnum" & D + nD1).Font.Bold = .ob_BiMonth.Value .Controls("dnum" & D + nD1).Font.Size = 11 .Controls("dnum" & D + nD2).Font.Bold = .ob_BiMonth.Value .Controls("dnum" & D + nD2).Font.Size = 11 End With End Sub
Sub pd_EoF() Dim wknm As Date Dim mywk As Long Dim x, j As Long With ufCal For j = 1 To 42 .Controls("dnum" & j).Font.Bold = False .Controls("dnum" & j).Font.Size = 9 Next j For x = 6 To 41 Step 7 If .Controls("dnum" & x).Caption <> "" Then wknm = .uMonth.Caption & "-" & .Controls("dnum" & x).Caption & "-" & .uYear.Caption mywk = myWeekNum(wknm) If wknm Mod 2 = 1 Then .Controls("dnum" & x).Font.Bold = .ob_EoF.Value .Controls("dnum" & x).Font.Size = 11 End If End If Next x End With End Sub


Reply With Quote
