hello
actually i try desighning the calendar on userform because i have occasions of days i would highlight theses days and show comments on textbox on userform i can't do that by ready tool calendar so i face a problem about the numbers of days it begins from 2 not 1 and if i choose the month it stays the locate numbers of days in the same place into textbox every month i choosed if my explenation doesn't clear please check my file you will understand it
this my code
Private Sub ComboBox1_Change()
For x = 1 To 38
Me("textbox" & x) = ""
Me("textbox" & x).BackColor = vbWhite
Next x
mn = Me.ComboBox1.Value
yr = Format(Date, "yyyy")
On Error Resume Next
a = Application.WorksheetFunction.Weekday(1 & "/" & mn & "/" & yr, 1)
Me("textbox" & a) = 1
For i = 1 To 38
Me("textbox" & a + i) = Format(CDate(i + 1 & "/" & mn & "/" & yr), "dd")
m = CDate(Me("textbox" & i) & "/" & mn & "/" & yr)
If m = Date Then
Me("textbox" & i).BackColor = vbRed
End If
Next i
End Sub
Private Sub UserForm_Initialize()
For i = 1 To 12
a = 1 & "/" & i & "/" & 2020
Me.ComboBox1.AddItem Format(a, "mmmm")
Next i
Me.ComboBox1.Value = Format(Date, "mmmm")
For x = 1 To 7
Me("textbox" & 42 + x) = Format(x, "ddd")
Next x
End Sub