List Box : Showing specific data from Master list

suhas_shah

New Member
Joined
Sep 23, 2006
Messages
39
In excel file there are two sheets

1. Enty Sheet
2. Master Sheet

In entry there are following columns

Code | Sub Code | qty.

In Master Sheet there are following columns

Code Sub Code


Master Data is as under

Code | Sub Code
101 | A01
101 | A02
102 | C022
102 | C021
103 | D02
103 | D03
103 | D04
104 | A02
104 | A01

In entry sheet when i ener Code in Column A , a list box showing all related values of CodeFrom Master Sheet to be shown in Column B of Entry Sheet.

Can you help me in this.

Regards

Suhas
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
Note: You did not say how the right "code" is to be selected, add the code that works for you for "myCode!"
I just call it "myCode" below!

Dim c As Object, myBottom&, myRng As Range

myBottom = ActiveSheet.Range("B65536").End(xlUp).Row

Set myRng = ActiveSheet.Range(Cells(1, 2), Cells(myBottom, 2))

For Each c In myRng

If c.OffSet(0, -1).Value= myCode Then
Worksheets("Sheet1").ListBox1.AddItem (c.Value)
End If
Next c
 

Forum statistics

Threads
1,141,681
Messages
5,707,791
Members
421,527
Latest member
Tamiwsw

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
Top