Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
#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!
#55179
Substitua esta linha
Código: Selecionar todos
lin = Sheets("Cadastro").Range("A2").End(xlDown).Row + 1
por esta
Código: Selecionar todos
lin = Sheets("Cadastro").Cells(Rows.Count, 1).End(xlUp).Row + 1
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord