'rebuilds the calendar when the year is changed by the user 'rebuilds the calendar when the month is changed by the user If i = 1 Then CB_Yr.AddItem Format((ThisDay), "yyyy") Else CB_Yr.AddItem _įormat((DateAdd("yyyy", (i - 1), ThisDay)), "yyyy") If "" ThenĬalendarFrm.Height = 191 + ĬB_Mth.AddItem Format(DateSerial(Year(Date), Month(Date) + i, 0), "mmmm")ĬB_Mth.ListIndex = Format(Date, "mm") - Format(Date, "mm") ![]() 'check cells for desired format to trigger the calendarfrm.show routine 'otherwise exit the sub Private Sub Worksheet_SelectionChange(ByVal Target As Range) This userform calendar control travels with the file and is readily available and easy to set up and use.Ĭlick on the sheet And add this code To the sheet Or sheets you wish To use the calendar on: If you use the native calendar contol from Excel and send your file to a different computer that doesn't have the same version or any calendar control installed, your calendar doesn't work and results in an error. ![]() Select the year and month, then click on the desired day and its entered into the cell formatted accordingly. Click on specifically formatted cells and a calendar userform pops up.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |