VLOOKUP copy worksheet to workbook

Minsterhol

New Member
Joined
Nov 9, 2011
Messages
2
I have 2 workbooks called Master and State. On the Master workbook, there are 4 worksheets (sheet1, sheet2, sheet3, Information). On the State workbook, there are 50 sheets named after each state (Alabama, Alaska, Arkansas, etc.).
I am trying to create a macro that will copy the correct state worksheet into the Master workbook based on the VLOOKUP. So in the Master workbook, if I select company X in Michigan, I want the Michigan worksheet copied to the Master workbook.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
1. "So in the Master workbook, if I select company X in Michigan,"

in which the name Michigan is availble in master workbook

2. "I want the Michigan worksheet copied to the Master workbook. "

in which sheet of the master workbook do you want the michigan data to be copied

3. if another state is clicked for e.g. texas do you want that data is to be copied in the same sheet
as michigan data (of course below the data) or do oou want it in different sheet of master workbook

4. if data of different sheets are copied in different sheets of master workbook(you needn50 sheets
in master workbook) do you want thsse sheets to be renames as state name.
 
Upvote 0
Only one state tab can be selected for each company. If company XYZ is selected on the Master workbook and their address is located in Michigan, just the Michigan tab from the State Workbook should be copied to the Master workbook so I have Sheet1, Sheet2, Sheet3, Information, and Michigan. The tab should be called Michigan on the Master workbook. THANKS!
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,955
Members
449,199
Latest member
Riley Johnson

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