USUÁRIO:      SENHA:        SALVAR LOGIN ?    Adicione o VBWEB na sua lista de favoritos   Fale conosco 

 

  Fórum

  Visual Basic
Voltar
Autor Assunto:  Duvida com o ListBox em VBA for Excel
Maeda
SAO PAULO
SP - BRASIL
ENUNCIADA !
Postada em 20/01/2009 11:03 hs            
Estou com uma dúvida referente ao procedimento com o ListBox em VBA for Excel.

Gostaria de saber como eu faço para que a cada consulta de um cliente nos botões próximo e anterior o List Box seja limpo e carregue as informações do proximo cliente.

Quando faço a consulta não está limpando e nem carregando as informações do próximo cliente.

No momento minha programavel é a seguinte:

'Botão Próximo de Fornecedor
Private Sub SpinButton2_SpinUp() 'fornecedor
xLinha1 = xLinha1 + 1 'Aumenta 1 linha
If Cells(xLinha1, 3).Value = xfor Then
Else
MsgBox "Último Fornecedor =" & xfor

'rotina para saber os numeros do serial number

xColuna = 10

xSerialN = Cells(2, xColuna).Value

LBSE.Clear


Do While xSerialN <> ""

LBSE.AddItem Cells(2, xColuna).Value

xColuna = xColuna + 2

xSerialN = Cells(2, xColuna).Value


Loop


'rotina para saber os numeros do part number

xColuna = 11

xPartN = Cells(2, xColuna).Value

LBPA.Clear

Do While xPartN <> ""

LBPA.AddItem Cells(2, xColuna).Value

xColuna = xColuna + 2

xPartN = Cells(2, xColuna).Value


Loop

'rotina para saber os numeros do serial number


xColuna = 12

xSerialN = Cells(2, xColuna).Value

LBSE1.Clear

Do While xSerialN <> ""

LBSE1.AddItem Cells(2, xColuna).Value

xColuna = xColuna +2

xSerialN = Cells(2, xColuna).Value


Loop

'rotina para saber os numeros do part number

xColuna = 13

xPartN = Cells(2, xColuna).Value

LBPA1.Clear


Do While xPartN <> ""

LBPA1.AddItem Cells(2, xColuna).Value

xColuna = xColuna +2

xPartN = Cells(2, xColuna).Value
Loop

mostra1

End If

End Sub
'ROTINA DO BOTÃO ANTERIOR FORNECEDOR
Private Sub SpinButton2_SpinDown() 'fornecedor
xLinha1 = xLinha1 - 1 'Decrementa 1 linha
If xLinha1 < 2 Then ' se a linha for menor que 2 (1ª linha de dados)
MsgBox "Inicio de Arquivo"
xLinha1 = 2

'rotina para saber os numeros do serial number

xColuna = 10

xSerialN = Cells(2, xColuna).Value

LBSE.Clear

Do While xSerialN <> ""

LBSE.AddItem Cells(2, xColuna).Value

xColuna = xColuna + 1

xSerialN = Cells(2, xColuna).Value

Loop


'rotina para saber os numeros do part number

xColuna = 11

xPartN = Cells(2, xColuna).Value

LBPA.Clear

Do While xPartN <> ""

LBPA.AddItem Cells(2, xColuna).Value

xColuna = xColuna + 1

xPartN = Cells(2, xColuna).Value

Loop

'rotina para saber os numeros do serial number


xColuna = 12

xSerialN = Cells(2, xColuna).Value

LBSE1.Clear

Do While xSerialN <> ""

LBSE1.AddItem Cells(2, xColuna).Value

xColuna = xColuna + 1

xSerialN = Cells(2, xColuna).Value


Loop

'rotina para saber os numeros do part number

xColuna = 13

xPartN = Cells(2, xColuna).Value

LBPA1.Clear

Do While xPartN <> ""

LBPA1.AddItem Cells(2, xColuna).Value

xColuna = xColuna + 2

xPartN = Cells(2, xColuna).Value

Loop

mostra1

Exit Sub
End If

End Sub

Gostaria da ajuda de vocês

Obrigada
   
Página(s): 1/1    


Seu Nome:

Seu eMail:

ALTERAR PARA MODO HTML
Mensagem:

[:)] = 
[:P] = 
[:(] = 
[;)] = 

HTML DESLIGADO

     
 VOLTAR

  



CyberWEB Network Ltda.    © Copyright 2000-2025   -   Todos os direitos reservados.
Powered by HostingZone - A melhor hospedagem para seu site
Topo da página