problem advanced filter on userform based on multiple combobox

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,429
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
hello
i face two problem first the combobox not populate data rowsource despite the same code with a little difference just change the column and the name combobox
the second when i choose item any combobox or toghether the summing values don't change it stay one fixing value
theses my code:
VBA Code:
Private Sub ComboBox3_Change()

Dim i, x As Integer

Dim mylist As String

With Me.ListBox1

For i = 1 To .ListCount - 1

For x = 1 To .ListCount - 1

If .List(x, 2) = Me.ComboBox3 Then

For c = 0 To 6

mylist = .List(x, c)

.List(x, c) = .List(i, c)

.List(i, c) = mylist

Me.ListBox1.Selected(i) = True

Next c

End If

Next x

Next i

Dim m As Integer

Dim sum, sum1 As Double

For m = 1 To .ListIndex()

sum = sum + Val(.List(m, 3))

sum1 = sum1 + Val(.List(m, 4))

Next m

Me.TextBox1 = Format(sum1, "####.00")

Me.TextBox2 = Format(sum, "####.00")

End With

End Sub

this line If .List(x, 2) = Me.ComboBox3 i change in combobox1,2 =If .List(x, 0) = Me.ComboBox1 & If .List(x, 1) = Me.ComboBox2
they works but with combobox 3 not
i hope somebodey help
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,212,931
Messages
6,110,745
Members
448,295
Latest member
Uzair Tahir Khan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top