[VBA] COMBOBOX SHOW WITH CONDITION

E

Eddie_SP

Hi community !

I one worksheet of international payments.
When I make the payment, column 10, Cell "row" Formula shows "PAID".

I have a Form with 1 Combobox.

How could I filter only the UNPAID rows to be shown in the Combobox?

But...

I need only Columns "A" and "B" to be shown (REFERENCE # / EXPORTER).

Can someone help me?

I thank you in advance !!!
This community is helping me a lot !!! =)
 
M

Matthew Herbert

Hi community !

I one worksheet of international payments.
When I make the payment, column 10, Cell "row" Formula shows "PAID".

I have a Form with 1 Combobox.

How could I filter only the UNPAID rows to be shown in the Combobox?

But...

I need only Columns "A" and "B" to be shown (REFERENCE # / EXPORTER).

Can someone help me?

I thank you in advance !!!
This community is helping me a lot !!! =)

Eddie_SP,

Have you tried using Filter? Search the help documentation for filter
to see how to use this. If your data is in a database layout, then
you'll be able to filter by the <blanks> or "unpaid".

Best,

Matthew Herbert
 
E

Eddie_SP

Hi Matthew,

The problem is that I'm new to VBA. And I've always used only RowSource,
understand me? :(
So I do not know how to include any value in Combobox by code...

But I will keep on trying here. =)

Thank you.
 
M

Matthew Herbert

Hi Matthew,

The problem is that I'm new to VBA. And I've always used only RowSource,
understand me? :(
So I do not know how to include any value in Combobox by code...

But I will keep on trying here. =)

Thank you.





- Show quoted text -

Eddie_SP,

Are you creating a combobox on a custom user form or a combobox within
a spreadsheet? (If it's a user form combobox, then look at
the .AddItem method).

Best,

Matt
 
E

Eddie_SP

GOT IT !!!!

Private Sub UserForm_Initialize()

Dim i As Integer
Dim ComboValue As String
Dim RangeCombo As String

ComboValue = Me.ComboBox1.Value

i = 13

While (ActiveSheet.Cells(1 + i, 11) <> 0)
i = i + 1
If Cells(1 + i, 11).Text = "NÃO PAGO" Then
Range(Cells(1 + i, 1), Cells(1 + i, 1)).Select
RangeCombo = Range(Cells(1 + i, 1), Cells(1 + i, 1))
With ComboBox1
.AddItem RangeCombo
End With
End If
Wend

End Sub


THANK YOOOOU ! =)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top