Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Lookup/Copy a Cell or Range by Worksheet name?

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #2

    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    With Workbooks("Workbook1").Sheets("Sheet1")
    .[B1].Copy Workbooks("Workbook2").Sheets(.[A1].Value).[B1]
    End With

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    359
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #4

    Join Date
    Mar 2002
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •