Lookup/Copy a Cell or Range by Worksheet name?

Cosmos75

Active Member
Joined
Feb 28, 2002
Messages
359
Is there a way to search for a value next to label by sheet. Say I have a few worksheets (1,2,3 and 4). In column A in each worksheet, I have a list of ingredients for recipies. I have another sheet, Summary, where I want to insert a formula that looks up an ingredient I specify on a sheet I specify. For example, I want to lookup the value in Column B, that is Next to the Ingredient SUGAR in Column A and I want the Sugar Value for the recipie in Worksheet 3. I need something that will work for more than 20 Worksheets. Any ideas?

Also, is it possible to copy the list of ingredients for each worksheet and have all the lists copied onto another worksheet? Keep in mind that the recipies WILL NOT have the same number of ingredients or even share common ingredients? I also need to copy which worksheet each list came from so I can identify on the summary list the recipie name (i.e. worksheet name), the ingredients and the amount of ingredient used in the recipie.

This really isn't for recipies, but it's the best analogy I can think of. Thanks in advance!!!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
With Workbooks("Workbook1").Sheets("Sheet1")
.[B1].Copy Workbooks("Workbook2").Sheets(.[A1].Value).[B1]
End With
 
Upvote 0
I am not quite sure how this is supposed to work? Am I supposed to create a new workbook? DO I substitute Workbook1 with the name of the new workbook, Sheet1 with the name of the sheet in the new workbook and Workbook2 with the name of the workbook I want to do the copyiong from?

I also get a syntax error for
.[B1].Copy Workbooks("Workbook2").Sheets(.[A1].Value).[B1]

So if my workbooks are named
Recipies (Workbook I want to copy from, i.e. Workbook2)
Search (Workbook1)
Find (Sheet1 in Workbook1)

The final code should look like
With Workbooks("Search").Sheets("Find")
.[B1].Copy Workbooks("Recipies").Sheets(.[A1].Value).[B1]
End With
End Sub

Is that correct??
 
Upvote 0
Sorry, my reply is not in answer to your question.
I must have clicked the wrong window (too many open windows!).
Will have a look at your question later, but perhaps someone else can respond in the meantime.
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,943
Members
448,534
Latest member
benefuexx

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