Private Sub CommandButton2_Click()
'Copy inut values to sheet.
Dim lRow As Long, BdyTxt As String
Dim ws As Worksheet
Set ws = Worksheets("ME Jobs")
BdyTxt = " - New job added to the register."
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.TextBox1.Value
.Cells(lRow, 3).Value = "ME" & Format(lRow - 6, "0000") '<<<<<<<<
.Cells(lRow, 4).Value = Me.ComboBox1.Value
.Cells(lRow, 5).Value = Me.TextBox3.Value
.Cells(lRow, 6).Value = Me.TextBox4.Value
.Cells(lRow, 7).Value = Me.ComboBox2.Value
End With
'Clear input controls.
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.ComboBox1.Value = ""
Me.TextBox3.Value = ""
Me.TextBox4.Value = ""
'Add your variable strings here-------------------------
If ComboBox2 = "BK117" Then
BdyTxt = "Programme: BK117" & BdyTxt
ElseIf ComboBox2 = "EC135" Then
BdyTxt = "Programme: EC135" & BdyTxt
End If
Me.ComboBox2.Value = ""
Call Email1("Jack.Burge@GKNAerospace.com", "New Job Added to ME Job Register", BdyTxt & _
" Please assign a suitable ME and priority to the new job.")
End Sub
Should do the trick!!