Creating lists from multiple sheets.

DylanMa

New Member
Joined
Jul 28, 2016
Messages
7
Hi,

I am wanting to know if I can in VBA;

Have a button that when it is clicked;

Searches the name written in a drop down box, the name is then located on another sheet column 1 of "Breakfast" the sheet name of the sheet from which I want the data is located in column 54 of the same page.

Once it has the sheet name I need it to search for the data on sheets("Name obtained from dropdown box").Range(A11:A35) but not include blank rows. and then add it to the sheets("Shopping List") Column 1 row 2.

Any help would be greatly appreciated.

Dylan
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Code:
strDropDown = Sheets("Sheet11").DropDowns("Drop Down 1").List(Sheets("Sheet11").DropDowns("Drop Down 1").ListIndex)
strSheet = Sheets("Sheet2").Columns(1).Find(strDropDown, , xlValues, xlWhole).Offset(, 1)
RowNumber = 2
With Sheets(strSheet)
    For Each Row In .Range("A11:A35").Rows
        If Application.CountA(Row.EntireRow) <> 0 Then
            Row.Copy Destination:=Worksheets("Sheet4").Range("A" & RowNumber)
            RowNumber = RowNumber + 1
    End If
    Next
End With

Change the references for your workbook.
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,310
Members
452,634
Latest member
cpostell

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