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.
Por LIVYWODIANER
#40927
Boa Tarde, estou criando uma planilha em VBA de lançamento de pedido e embalagens.

Preciso de uma função que ative o código salvar após inserir texto no txtsku1 e pressionar enter.

Private Sub btnSALVAR_Click()

Dim linha As Integer

Set result = Sheets("EMBALAGEM").Range("B1:B400").Find(txtsku1.Value, lookat:=xlWhole)
If result Is Nothing Then
MsgBox "EMBALAGEM NÃO CADASTRADA"
txtsku1.Value = ""
Txtpedido.Value = ""

Txtpedido.SetFocus

Exit Sub

End If

linha = Sheets("AuxLanc").Range("B2").Value
With Sheets("LANCAMENTO")
.Range("A" & linha).Value = linha
.Range("B" & linha).Value = frmLANCAMENTO.Txtpedido.Text
.Range("C" & linha).Value = frmLANCAMENTO.txtsku1.Text
End With

Sheets("AuxLanc").Range("B2").Value = linha + 1


Call LIMPAR2

End Sub
Você não está autorizado a ver ou baixar esse anexo.
Por mprudencio
Posts
#40996
Nao vi a planilha.

Estou supondo que txtsku1 é uma textbox em um formulario

Experimente assim:

If txtsku1.value = "" Then
MsgBox "EMBALAGEM NÃO CADASTRADA"
Exit sub
End if


Coloque no inicio do codigo.
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