sossego385011
01-05-2017 20:13:09
Boa tarde
uso este código para buscar as informações para um formulário, mas preciso que ele desconsidere as linhas em branco
Private Sub ListCodigo_Change()
Dim Lin As Integer
Lin = 4
Do Until Sheets("Produtos").Cells(Lin, 1).Value = Empty
If Sheets("Produtos").Cells(Lin, 1).Text = ListCodigo.Value Then
TxtDescrição.Value = Sheets("Produtos").Cells(Lin, 2).Value
TxtPreço.Value = Sheets("Produtos").Cells(Lin, 7).Value
TxtQntde.Value = Sheets("Produtos").Cells(Lin, 3).Value
TxtCodigo.Value = Sheets("Produtos").Cells(Lin, 1).Value
Exit Do
End If
Lin = Lin + 1
Loop
End Sub
uso este código para buscar as informações para um formulário, mas preciso que ele desconsidere as linhas em branco
Private Sub ListCodigo_Change()
Dim Lin As Integer
Lin = 4
Do Until Sheets("Produtos").Cells(Lin, 1).Value = Empty
If Sheets("Produtos").Cells(Lin, 1).Text = ListCodigo.Value Then
TxtDescrição.Value = Sheets("Produtos").Cells(Lin, 2).Value
TxtPreço.Value = Sheets("Produtos").Cells(Lin, 7).Value
TxtQntde.Value = Sheets("Produtos").Cells(Lin, 3).Value
TxtCodigo.Value = Sheets("Produtos").Cells(Lin, 1).Value
Exit Do
End If
Lin = Lin + 1
Loop
End Sub