- 24 Mai 2020 às 21:42
#55176
Boa noite!
Está aparecendo o erro em tempo de execução 1004: erro de definição de aplicativo ou definição de objeto. O erro aparece onde está na cor azul.
Private Sub cmd_cadastrar_Click()
Sheets("Cadastro").Activate
lin = Range("A2").End(xlDown).Row + 1
Cells(lin, 1) = txtnome.Value
Cells(lin, 2) = cb_sexo.Value
Cells(lin, 3) = txtcpf.Value
Cells(lin, 4) = txtrg.Value
Cells(lin, 5) = txtendereco.Value
Cells(lin, 6) = txtbairro.Value
Cells(lin, 7) = txtcidade.Value
Cells(lin, 8) = cb_uf.Value
Cells(lin, 9) = txttelefones.Value
Cells(lin, 10) = txtproduto.Value
Cells(lin, 11) = txtcor.Value
Cells(lin, 12) = txtvalor.Value
Cells(lin, 13) = txtfrete.Value
Cells(lin, 14) = txttotal.Value
Cells(lin, 15) = cb_formapgto.Value
Cells(lin, 16) = txtobservacoes.Value
nome = txtnome.Value
sexo = cb_sexo.Value
MsgBox "Dados cadastrados com sucesso!"
End Sub
Alguém pode me ajudar?
Aguardo respostas!
Está aparecendo o erro em tempo de execução 1004: erro de definição de aplicativo ou definição de objeto. O erro aparece onde está na cor azul.
Private Sub cmd_cadastrar_Click()
Sheets("Cadastro").Activate
lin = Range("A2").End(xlDown).Row + 1
Cells(lin, 1) = txtnome.Value
Cells(lin, 2) = cb_sexo.Value
Cells(lin, 3) = txtcpf.Value
Cells(lin, 4) = txtrg.Value
Cells(lin, 5) = txtendereco.Value
Cells(lin, 6) = txtbairro.Value
Cells(lin, 7) = txtcidade.Value
Cells(lin, 8) = cb_uf.Value
Cells(lin, 9) = txttelefones.Value
Cells(lin, 10) = txtproduto.Value
Cells(lin, 11) = txtcor.Value
Cells(lin, 12) = txtvalor.Value
Cells(lin, 13) = txtfrete.Value
Cells(lin, 14) = txttotal.Value
Cells(lin, 15) = cb_formapgto.Value
Cells(lin, 16) = txtobservacoes.Value
nome = txtnome.Value
sexo = cb_sexo.Value
MsgBox "Dados cadastrados com sucesso!"
End Sub
Alguém pode me ajudar?
Aguardo respostas!