Populating area of a worksheet

Schwyl

New Member
Joined
Jan 25, 2014
Messages
30
Hey Every . I've tried searching but I'm not even sure what I want to call what I want to do.

I'm wanting to create a worksheet that based on the selection in a dropdown menu will populate rows based on a cell match.


DataSheet
Data1Data2Data3Data4Data5Data6Data7
Thing1Stuff1Stuff2Stuff3Stuff4Stuff5Stuff6
Thing2Stuff1Stuff2Stuff3Stuff4Stuff5Stuff6
Thing3Stuff1Stuff2Stuff3Stuff4Stuff5Stuff6

Fancy sheet

So I want this to have a Drop Down with a list of thing 1,2,3 Depending on which one is selected I want any row that has it in column A to be populated on my other sheet.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Change references as required.
Code:
Sub Maybe()
Dim sh1 As Worksheet, sh2 As Worksheet, c As Range
Set sh1 = Worksheets("From_Sheet")
Set sh2 = Worksheets("To_Sheet")
    For Each c In sh1.Range("A2:A" & sh1.Cells(Rows.Count, 1).End(xlUp).Row)
        If c.Value = Cells(1, 2).Value Then c.EntireRow.Copy sh2.Cells(Rows.Count, 1).End(xlUp).Offset(1)
    Next c
End Sub

If your data range is large, autofilter should be faster.
 
Upvote 0
Solution
Just wondering. Have you had time to try it yet and if so, did it work?
 
Upvote 0
Thank you for letting us know. We can now delete the test workbook.
Good Luck
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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