Olá pessoal, sou novata em VBA e, ao tentar manter todas as planilhas protegidas para que os usuários da planilha não modifiquem nada, tive problemas com o Cells.Find - não localiza na planilha bloqueada em questão.
Alguém sabe como resolver?
Sub PesquisaResumo_Clique()
Application.ScreenUpdating = False
CPF = Cells(12, 6)
If CPF = 0 Then
MsgBox "Digite um CPF válido", cvOKONly
Exit Sub
End If
Sheets("Dados").Visible = True
Sheets("Dados").Select
If Cells.Find(CPF) Is Nothing Then
MsgBox "Trabalhador(a) não encontrado! Digite um CPF válido", vbOKOnly
Sheets("Dados").Visible = False
Sheets("Início").Select
Exit Sub
End If
If Not Cells.Find(CPF) Is Nothing Then
Nome = Cells.Find(CPF).Offset(0, -3)
dtnasc = Cells.Find(CPF).Offset(0, -2)
sexo = Cells.Find(CPF).Offset(0, -1)
nCPF = Cells.Find(CPF).Offset(0, 0)
rg = Cells.Find(CPF).Offset(0, 1)
ssp = Cells.Find(CPF).Offset(0, 2)
uf = Cells.Find(CPF).Offset(0, 3)
emissao = Cells.Find(CPF).Offset(0, 4)
titulo = Cells.Find(CPF).Offset(0, 5)
zona = Cells.Find(CPF).Offset(0, 6)
secao = Cells.Find(CPF).Offset(0, 7)
escol = Cells.Find(CPF).Offset(0, 8)
prof = Cells.Find(CPF).Offset(0, 9)
num = Cells.Find(CPF).Offset(0, 10)
cargo = Cells.Find(CPF).Offset(0, 11)
ch = Cells.Find(CPF).Offset(0, 12)
vinculo = Cells.Find(CPF).Offset(0, 13)
tipo = Cells.Find(CPF).Offset(0, 14)
endereco = Cells.Find(CPF).Offset(0, 15)
numero = Cells.Find(CPF).Offset(0, 16)
complemento = Cells.Find(CPF).Offset(0, 17)
bairro = Cells.Find(CPF).Offset(0, 18)
referencia = Cells.Find(CPF).Offset(0, 19)
cep = Cells.Find(CPF).Offset(0, 20)
fone = Cells.Find(CPF).Offset(0, 21)
ramal = Cells.Find(CPF).Offset(0, 22)
celular = Cells.Find(CPF).Offset(0, 23)
Email = Cells.Find(CPF).Offset(0, 24)
inicio = Cells.Find(CPF).Offset(0, 25)
fim = Cells.Find(CPF).Offset(0, 26)
Sheets("Dados").Visible = False
Sheets("Início").Select
Range("F14") = Nome
Range("J14") = dtnasc
Range("F16") = prof
Range("I16") = cargo
Range("L14") = ch
Range("F18") = fone
Range("G18") = ramal
Range("H18") = celular
Range("I18") = Email
Range("L16") = inicio
Range("L18") = fim
Application.ScreenUpdating = True
End If
End Sub