Filtering Data

MKK

New Member
Joined
Nov 15, 2005
Messages
20
Hello All,

This is how my data in the excel sheet look like..

Pin Name Type Site
----------- ------- -------
IS HVIO 5.a16
GND_OUT3 HVIO 5.d26
GND_OUT HVIO 5.a20
VBB HVIO 5.d18
VBB_HS HVIO 5.a24
VBB_HS_CAP HVIO 5.a28
NC_5_DC DCVI 10.a12
NC_6_DC DCVI 10.a8
DELAY_DC DCVI 10.a2
INH_DC DCVI 10.a6
IN_DC DCVI 10.a10
IS_DC DCVI 10.a14
T3 I/O 11.b18
T4 I/O 11.d18
T5 I/O 11.a17
T6 I/O 11.c17
T7 I/O 11.b16
T8 I/O 11.d16
T9 I/O 11.a15
K5 Utility 8.b36
K6A_D Utility 8.c36
K7ABC Utility 8.d36
K8AB Utility 8.a37
K9ABC Utility 8.b37
K10AB Utility 8.c37


I have to get Pin name as input in the userform according to the Type mentioned..this is what i have wrote for it...
----------------------------------
Private Sub UserForm_Activate()
Dim s1 As String

Me.ComboBox1.Clear


For Row = 6 To 16
s1 = Worksheets("Chans Site1").Cells(Row, 2).Text

ComboBox1.AddItem s1

Next Row
End Sub
----------------------------------

Now the problem is If the "Type" is not in order ...like...

Pin Name Type Site
------------- --------- --------
IS HVIO 5.a16
GND_OUT3 HVIO 5.d26
NC_6_DC DCVI 10.a8
DELAY_DC DCVI 10.a2
VBB HVIO 5.d18
T5 I/O 11.a17
T6 I/O 11.c17
VBB_HS HVIO 5.a24
VBB_HS_CAP HVIO 5.a28
NC_5_DC DCVI 10.a12

There are many test userforms.The combo boxes in these userforms should show only a particlar "Type" inputs ...
For ex. For DCVI tests the combo box in the DCVI userform should show only the pins for DCVI type..


what should I do...Can anyone plz help me...

Thanks in advance

Regards,

MKK
 

Some videos you may like

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.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Like this?

Code:
Private Sub UserForm_Activate()
    Dim r As Long
    ComboBox1.Clear
    With Worksheets("Chans Site1")
        For r = 1 To .Range("A65536").End(xlUp).Row
            If .Cells(r, 2).Value = "DCVI" Then
                ComboBox1.AddItem .Cells(r, 1).Value
            End If
        Next r
    End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,118,167
Messages
5,570,636
Members
412,334
Latest member
ExcelForLifeDontHate
Top