Hello, I need some help with a datepicker. I hope somebody can help me.
I am trying to get a datepicker to appear when user clicks into a designated textbox . I would then like the user to select a date and that date to appear in the textbox. Will be two textboxs(both with datepicker) and then the code will need to copy all dates (from that interval of time) existing on a sheet from workbook.
I don`t know how to generate that datepicker when user clicks into the textbox.
I wrote a code to copy that dates, but I can`t create the datepicker ,so I`m not sure if the code is right.
I am trying to get a datepicker to appear when user clicks into a designated textbox . I would then like the user to select a date and that date to appear in the textbox. Will be two textboxs(both with datepicker) and then the code will need to copy all dates (from that interval of time) existing on a sheet from workbook.
I don`t know how to generate that datepicker when user clicks into the textbox.
I wrote a code to copy that dates, but I can`t create the datepicker ,so I`m not sure if the code is right.
Code:
DestRow = 2
For SrcRow = 2 To Sheets("Faza2").UsedRange.Rows.Count
If DateValue(ThisWorkbook.Sheets("Faza2").Cells(SrcRow, 1)) > DateValue(UserForm1.TextBox1) And _
DateValue(ThisWorkbook.Sheets("Faza2").Cells(SrcRow, 1)) < DateValue(UserForm1.TextBox2) And _
ThisWorkbook.Sheets("Faza2").Cells(SrcRow, 5) = UserForm1.ComboBox1.Value Then
ThisWorkbook.Sheets("aux").Cells(DestRow, 2) = ThisWorkbook.Sheets("Faza2").Cells(SrcRow, 1)
ThisWorkbook.Sheets("aux").Cells(DestRow, 3) = ThisWorkbook.Sheets("Faza2").Cells(SrcRow, 11)
DestRow = DestRow + 1
End If
Next