Excel 2007 Formula to Pull Range of Data Based on Drop Down Selection

Please see attached as an example.  I am looking for a formula that looks at what is selected in the drop down cell (B3) and will pull all of the elements of the description on sheet 2.  For example, if Peach is selected on sheet 1 then two cells in column C would show Fuzzy and Pit.  If Apple is selected, then 3 cells to the right of the drop down in column C would show Red, Sweet and Cooking.  If a VB code is required that works too.

Thanks!!!
EE-Example.xlsx
LVL 1
EscanabaManager - HR AnalyticsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
try:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Row = 3 And Target.Column = 2 Then
        Range("C3:C1000").ClearContents
        lastRow = Sheets("Sheet2").Cells(Rows.Count, "D").End(xlUp).Row
        j = 3
        
        For i = 2 To lastRow
            If Sheets("Sheet2").Cells(i, 3) <> "" Then
                v = Sheets("Sheet2").Cells(i, 3)
            End If
            If v = Target.Value Then
                Cells(j, 3) = Sheets("Sheet2").Cells(i, 4)
                j = j + 1
            End If
        Next
    End If
End Sub

Open in new window

Roy CoxGroup Finance ManagerCommented:
Why would Peach have two cells in Column C, butApple would have details on a Row?
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
is this what you mean?
EE-Example-b.xlsm
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

EscanabaManager - HR AnalyticsAuthor Commented:
Ryan - That appears to be spot on.  What would I change in your code to move the description results to a different column/cell?  For example, if I wanted the results to appear starting in cell B6.
Roy CoxGroup Finance ManagerCommented:
Is this what you mean using formulas
EE-Example.xlsx
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
>>For example, if I wanted the results to appear starting in cell B6.

try:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Row = 3 And Target.Column = 2 Then
        Range("B6:B1000").ClearContents
        lastRow = Sheets("Sheet2").Cells(Rows.Count, "D").End(xlUp).Row
        j = 6
       
        For i = 2 To lastRow
            If Sheets("Sheet2").Cells(i, 3) <> "" Then
                v = Sheets("Sheet2").Cells(i, 3)
            End If
            If v = Target.Value Then
                Cells(j, 2) = Sheets("Sheet2").Cells(i, 4)
                j = j + 1
            End If
        Next
    End If
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EscanabaManager - HR AnalyticsAuthor Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.