1. Welcome to the forums
2. I added CODE and /CODE tags around your macro - you can use the [#] icon to insert them and paste your macro between
3. Worthwhile to read the FAQs (see my sig)
4. I don't think you understand the If-Then-ElseIf- ... -End If structure/syntax
Something like these are not correct or not as you might intend
If DeptOptionButton5.Value = True Then
End If
If CheckBox1.Value = True Then
Sheets("Ovine Slaughter").Cells(Sheets("Ovine Slaughter").Range("Z1"), 4) = DateTextBox.Value
End If
Else
This is example, but you can see how the If (or ElseIf) parts are 'paired' with the End If
If DeptOptionButton5.Value = True Then ' A
If CheckBox1.Value = True Then ' B
Sheets("Ovine Slaughter").Cells(Sheets("Ovine Slaughter").Range("Z1"), 4) = DateTextBox.Value
ElseIf DeptOptionButton6.Value = True Then 'B
If CheckBox1.Value = True Then ' C
Sheets("Ovine Boning").Cells(Sheets("Ovine Boning").Range("Z1"), 4) = DateTextBox.Value
End If ' C
End If 'B
End IF ' A
Since I don't understand your process flow, I can't suggest alternative VBA approaches
I find a macro is more understand able using indents at each level and appropriate white space between blocks
So just re-formatting a piece (PS - you don't really need the '= True' for the Checkboxes) it'd look something like this
Option Explicit
Private Sub AddButton_Click()
If DeptOptionButton5.Value Then
If CheckBox1.Value Then
Sheets("Ovine Slaughter").Cells(Sheets("Ovine Slaughter").Range("Z1"), 4) = DateTextBox.Value
ElseIf DeptOptionButton6.Value Then
If CheckBox1.Value Then
Sheets("Ovine Boning").Cells(Sheets("Ovine Boning").Range("Z1"), 4) = DateTextBox.Value
End If
ElseIf DeptOptionButton7.Value Then
If CheckBox1.Value Then
Sheets("Stock Yards Beef").Cells(Sheets("Stock Yards Beef").Range("Z1"), 4) = DateTextBox.Value
End If
Else
'do something else
End If
MsgBox "New Worker training added."
End Sub
Personal opinion of course -- the computer doesn't care what it looks like