Tuesday, November 29, 2016

Fast Date Entry To Active Cell With Right-Click Menu

Userform To Insert Date (Alternative To Date Picker and Calendar Control)

       
         With the userform that we created, data can be easily entered into the active cell.
When the user right-clicks on the active cell, the userform is opened. The userform contains three combo boxes (for month,day,year).

          The date selected from the combo boxes is displayed as short date (dd.mm.yyyy) in the textbox. The day name for the date is reported in the label control on textbox's right ; sunday,monday etc. Related codes :
"TextBox1 = VBA.Format(DateSerial(VBA.CLng(Me.cboYear.Value), Me.cboMonth.ListIndex + 1, Me.cboDay.Value))
Label1.Caption = WeekdayName(Weekday(TextBox1, 0), False, 0)
.."
           When the button is pressed, the selected date is entered into the cell and userform closes.

Userform To Insert Date -Alternative To Date Picker and Calendar Control