Private Sub Submitbutton_Click()
Dim FindString As String
Dim Rng As Range
FindString = Range("e11").Value
If Trim(FindString) = "" Then Exit Sub
'manage errors
On Error GoTo ExitSub
'search range
Set Rng = Sheets("manager 1").Columns(6).Find(What:=FindString, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False)
If Not Rng Is Nothing Then
'turn events off
With Application
.ScreenUpdating = False: .EnableEvents = False: .Calculation = xlCalculationManual
End With
'add data to worksheet
If Rng.Offset(0, 0).Value = TextBox26.Value Then
Else
Rng.Offset(0, 0).Value = TextBox26.Value
End If
If Rng.Offset(0, -5).Value = ComboBox19.Value Then
Else
Rng.Offset(0, -5).Value = ComboBox19.Value
End If
If Rng.Offset(0, -1).Value = ComboBox2.Value Then
Else
Rng.Offset(0, -1).Value = ComboBox2.Value
End If
'position
If Rng.Offset(0, 1).Value = TextBox4.Value Then
Else
Rng.Offset(0, 1).Value = TextBox4.Value
End If
'hire date
If Rng.Offset(0, 2).Value = TextBox7.Value Then
Else
Rng.Offset(0, 2).Value = TextBox7.Value
End If
'current role start date
If Rng.Offset(0, 3).Value = TextBox15.Value Then
Else
Rng.Offset(0, 3).Value = TextBox15.Value
End If 'function start date
If Rng.Offset(0, 4).Value = ComboBox3.Value Then
Else
Rng.Offset(0, 4).Value = ComboBox3.Value
End If
'status
If Rng.Offset(0, 5).Value = TextBox9.Value Then
Else
Rng.Offset(0, 5).Value = TextBox9.Value
End If
'status start date
If Rng.Offset(0, 6).Value = TextBox10.Value Then
Else
Rng.Offset(0, 6).Value = TextBox10.Value
End If
'salary
If Rng.Offset(0, 7).Value = ComboBox4.Value Then
Else
Rng.Offset(0, 7).Value = ComboBox4.Value
End If
'review grade
If Rng.Offset(0, 9).Value = ComboBox5.Value Then
Else
Rng.Offset(0, 9).Value = ComboBox5.Value
End If
'ly review grade
If Rng.Offset(0, 8).Value = ComboBox6.Value Then
Else
Rng.Offset(0, 8).Value = ComboBox6.Value
End If
'potential scope
If Rng.Offset(0, 10).Value = ComboBox7.Value Then
Else
Rng.Offset(0, 10).Value = ComboBox7.Value
End If
'ly potential scope
If Rng.Offset(0, 11).Value = ComboBox8.Value Then
Else
Rng.Offset(0, 11).Value = ComboBox8.Value
End If
'learning offer adp/mdp
If Rng.Offset(0, 12).Value = ComboBox9.Value Then
Else
Rng.Offset(0, 12).Value = ComboBox9.Value
End If
'learing offer %
If Rng.Offset(0, 13).Value = TextBox22.Value Then
Else
Rng.Offset(0, 13).Value = TextBox22.Value
End If
'learning offer sign off date
If Rng.Offset(0, 14).Value = TextBox21.Value Then
Else
Rng.Offset(0, 14).Value = TextBox21.Value
End If
'mother tongue
If Rng.Offset(0, 15).Value = ComboBox10.Value Then
Else
Rng.Offset(0, 15).Value = ComboBox10.Value
End If
'additional lang 1
If Rng.Offset(0, 16).Value = ComboBox11.Value Then
Else
Rng.Offset(0, 16).Value = ComboBox11.Value
End If
'additional lang 2
If Rng.Offset(0, 17).Value = ComboBox12.Value Then
Else
Rng.Offset(0, 17).Value = ComboBox12.Value
End If
'additional lang 3
If Rng.Offset(0, 18).Value = ComboBox13.Value Then
Else
Rng.Offset(0, 18).Value = ComboBox13.Value
End If
'secondment
If Rng.Offset(0, 19).Value = ComboBox14.Value Then
Else
Rng.Offset(0, 19).Value = ComboBox14.Value
End If
'length of secodment
If Rng.Offset(0, 20).Value = ComboBox15.Value Then
Else
Rng.Offset(0, 20).Value = ComboBox15.Value
End If
'relocation 1
If Rng.Offset(0, 21).Value = ComboBox16.Value Then
Else
Rng.Offset(0, 21).Value = ComboBox16.Value
End If
'relocation 2
If Rng.Offset(0, 22).Value = ComboBox17.Value Then
Else
Rng.Offset(0, 22).Value = ComboBox17.Value
End If
'learning offer courses
If Rng.Offset(0, 23).Value = ComboBox18.Value Then
Else
Rng.Offset(0, 23).Value = ComboBox18.Value
End If
'rdf courses
'inform user
'MsgBox "Comment Saved",64, "Record Saved"
End If
ExitSub:
'turn events on
With Application
.ScreenUpdating = True: .EnableEvents = True: .Calculation = xlCalculationAutomatic
End With
If Err > 0 Then
'report errors
MsgBox (Error(Err)), 48, "Error"
Else
'close form
If Not Rng Is Nothing Then
MsgBox ("Updates Saved")
Else
'inform user
MsgBox "Nothing found", 64, "Not Found"
End If
End If
End Sub