Vídeo recomendado
https://youtu.be/diWPPPhW-9E

COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO [RESOLVIDO]

Dúvidas gerais sobre Excel
ROGER_HOLANDA
Acabou de chegar
Acabou de chegar
Mensagens: 7
Registrado em: Qui Mar 03, 2016 5:39 pm

COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO [RESOLVIDO]

Mensagem por ROGER_HOLANDA »

Boa tarde caros amigos,

Preciso utilizar uma informação selecionada em uma determinada combobox, porem independente do item escolhido ele me retorna somente a primeira condição, no caso do código abaixo "yes". De que forma posso fazer isso funcionar?

Private Sub UserForm_Initialize()

Combobox.AddItem "BRADESCO"
Combobox.AddItem "BRASIL"

End Sub
_______________________________________
Private Sub VERIFICAR_BANCO()

If Combobox = BRADESCO Then
MsgBox ("yes")
Else
MsgBox ("no")
End If
End Sub
Editado pela última vez por ROGER_HOLANDA em Seg Mar 26, 2018 3:55 pm, em um total de 1 vez.


Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


srobles
Jedi
Jedi
Mensagens: 805
Registrado em: Qua Mai 06, 2015 7:39 pm

Re: COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO

Mensagem por srobles »

ROGER_HOLANDA,

Veja se é isso o que busca.

Código: Selecionar todos

Private Sub UserForm_Initialize()
    With Me.ComboBox
        .Clear
        .AddItem "BRADESCO"
        .AddItem "BRASIL"
    End With
End Sub

Private Sub ComboBox_Change()
    If ComboBox = "BRADESCO" Then
        MsgBox ("yes")
    Else
        MsgBox ("no")
    End If
End Sub
Abs


ROGER_HOLANDA
Acabou de chegar
Acabou de chegar
Mensagens: 7
Registrado em: Qui Mar 03, 2016 5:39 pm

Re: COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO

Mensagem por ROGER_HOLANDA »

Amigo,

Muito obrigado pelo auxilio, mas não funcionou.
Ele me retorna somente "no".
quando retiro as aspas de BRADESCO na condição ele me retorna somente "yes"


Avatar do usuário
Reinaldo
Jedi
Jedi
Mensagens: 1537
Registrado em: Sex Ago 01, 2014 4:09 pm
Localização: Garça - SP / SCS - SP

Re: COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO

Mensagem por Reinaldo »

Muito mais simples se disponibilizar seu modelo e rotina


Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


srobles
Jedi
Jedi
Mensagens: 805
Registrado em: Qua Mai 06, 2015 7:39 pm

Re: COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO

Mensagem por srobles »

ROGER_HOLANDA,

Veja se o modelo em anexo, ajuda a solucionar o problema, já que para isso, não tem segredo. :lol:

Abs
Anexos
modelo-1.zip
(12.49 KiB) Baixado 265 vezes


jorgegc
Acabou de chegar
Acabou de chegar
Mensagens: 4
Registrado em: Ter Fev 20, 2018 2:06 pm

Re: COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO

Mensagem por jorgegc »

Boa tarde Roger,
Segue o modelo em anexo verifique se e desta forma que deseja.
Anexos
modelo-1.rar
(14.73 KiB) Baixado 272 vezes


ROGER_HOLANDA
Acabou de chegar
Acabou de chegar
Mensagens: 7
Registrado em: Qui Mar 03, 2016 5:39 pm

Re: COMO UTILIZAR VALOR SELECIONADO EM COMBOBOX PARA UMA CONDIÇÃO [RESOLVIDO]

Mensagem por ROGER_HOLANDA »

Deu certo,

Muito Obrigado!


Disable adblock

This site is supported by ads and donations.
If you see this text you are blocking our ads.
Please consider a Donation to support the site.


Responder