![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
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!!! |
|
|
|
|
|
#2 |
|
Join Date: Mar 2002
Posts: 33
|
With Workbooks("Workbook1").Sheets("Sheet1")
.[B1].Copy Workbooks("Workbook2").Sheets(.[A1].Value).[B1] End With |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Tulsa, OK
Posts: 354
|
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?? |
|
|
|
|
|
#4 |
|
Join Date: Mar 2002
Posts: 33
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|