Hello everyone

I'm kind of a noob working on Excel VBA and I need your help, please.
I'm doing a data entry form on VBA and I want it to block an entry of a client's Code Number (written in portuguese is "código") if its already registered, also when I add a new row of data I want that row to be protected, and then skip to the next row.
To do that I'm following this video https://www.youtube.com/watch?v=a9gRw_ZuSyE

My database goes starts on E6 to Q6 and has no end. Can you correct my code? the code I have is the following:

'''''''check the duplicate Código
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Base de Dados Profissionais")
Dim n As Long


If Application.WorksheetFunction.CountIf(sh.Range("E:E"), Me.TextBox1.Value) > 0 Then
MsgBox "Este Código já se encontra registado na Base de Dados de Profissionais.", vbCritical
Exit Sub
End If


n = sh.Range("E" & Application.Rows.Count).End(xlUp).Row
sh.Unprotect "00"




sh.Range("E" & n + 1).Value = Me.TextBox16.Value
sh.Range("G" & n + 1).Value = Me.TextBox1.Value
sh.Range("H" & n + 1).Value = Me.TextBox7.Value
sh.Range("I" & n + 1).Value = Me.TextBox8.Value
sh.Range("K" & n + 1).Value = Me.TextBox10.Value
sh.Range("M" & n + 1).Value = Me.TextBox12.Value
sh.Range("L" & n + 1).Value = Me.TextBox9.Value
sh.Range("N" & n + 1).Value = Me.TextBox11.Value
sh.Range("Q" & n + 1).Value = Me.TextBox15.Value
sh.Range("P" & n + 1).Value = Me.TextBox14.Value
sh.Range("O" & n + 1).Value = Me.TextBox13.Value




If Me.OptionButton1.Value = True Then sh.Range("F" & n + 1).Value = "Empresa"
If Me.OptionButton2.Value = True Then sh.Range("F" & n + 1).Value = "Particular"
sh.Range("J" & n + 1).Value = Me.ComboBox1.Value


sh.Protect "00"

End Sub