- 07 Fev 2019 às 11:00
#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
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.