Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Filtering data using combo box

$
0
0

I am trying to make a combobox which would filter my data but i am having a object reference error at there. The purpose of this is to filter the data which would show the data on the data list. the user press on a button, it would open up a userform page in which he can choose his criteria.

I am very new to VBA. I have 20000 rows and 35 columns. The data in which i would like to filter is in E. I have use a small portion of my data to reference data by using the userform where i went to the row source and reference a small portion of the data instead of trying to remove the duplicate data. If there is any question do let me know.

Btw rt01 is the page name

Private Sub ComboBox1_Change()
Dim database(1 To 100000, 1 To 35)
Dim My_Range As Integer
Dim colum As Byte

Rt01.Range("E2").AutoFilter field:=5, Criterial:=Me.ComboBox1.Value 'this is where i am having the error 
For i = 2 To Sheet1.Range("A10000000").End(xlUp).Row
If R01.Cells(i, 1) = Me.ComboBox1 Then

My_Range = My_Range + 1
For colum = 1 To 35
database(My_Range, colum) = R01.Cells(i, colum)
Next colum
End If
Next i
Me.ListBox1.List = database
End Sub

Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>