Hi all
I have made a user form and what I want to do is to not let the user close it until they have filled in certain parts of it, so that when they press the submit button there must be
1) a date selected on the calender
and
2) something entered into the textbox
Ideally some sort of pop up that says please select a date, please enter a value in the textbox
So far my code for the submit button is:-
Also a kind of 'are you sure you have entered everything' confirmation would be handy as they have a fair few checkboxes to choose from'Data into sheet
Private Sub CommandButton1_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Data1")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.Calendar1.Value
ws.Cells(iRow, 2).Value = Me.Textbox1.Value
ws.Cells(iRow, 3).Value = CheckBox1.Value
ws.Cells(iRow, 4).Value = CheckBox2.Value
ws.Cells(iRow, 5).Value = CheckBox3.Value
ws.Cells(iRow, 6).Value = CheckBox4.Value
Set ws = Worksheets("Sheet2")
Unload Me
End Sub
I'm hoping there might be a nifty little bit of code that I could use for this!
Many thanks in advance
Bookmarks