Hi,
I have created a userform and have set it up so the user will add the date by selecting the day on a listbox1, month listbox2 and year listbox3.
This seems to work but I think it would look cleaner if I could set the user form to have todays date as default but if this date needs to be changed then the user can. Here I am happy to take further advice and either use the listboxes as I have or a drop down calender if possible.
This is what I have at the moment.
As you can see I currently have error msg if the date fields are not completed so would need to bypass this if the default date is used.
I have created a userform and have set it up so the user will add the date by selecting the day on a listbox1, month listbox2 and year listbox3.
This seems to work but I think it would look cleaner if I could set the user form to have todays date as default but if this date needs to be changed then the user can. Here I am happy to take further advice and either use the listboxes as I have or a drop down calender if possible.
This is what I have at the moment.
Code:
[Code] Private Sub CommandButton1_Click()
If ListBox100.Value = "" Or ListBox3.Value = "" Or ListBox4.Value = "" Or ListBox5.Value = "" Then
MsgBox "Please Ensure all Required Fields are completed before progressing"
Exit Sub
End If
If ListBox2.Value = "" Then
MsgBox "Please Ensure all Required Fields are completed before progressing"
Exit Sub
End If
Worksheets("Working").Cells(2, 1).Value = ListBox100.Value 'Name
Worksheets("Working").Cells(2, 2).Value = ListBox3.Value 'day
Worksheets("Working").Cells(3, 2).Value = ListBox4.Value 'month
Worksheets("Working").Cells(4, 2).Value = ListBox5.Value 'year
Worksheets("Working").Cells(4, 1).Value = TextBox6.Value 'ref
Worksheets("Working").Cells(5, 1).Value = ListBox2.Value 'work type
Worksheets("Working").Cells(6, 1).Value = TextBox5.Value ' notes
Unload Me
End Sub
As you can see I currently have error msg if the date fields are not completed so would need to bypass this if the default date is used.