+ Reply to Thread
Results 1 to 10 of 10

Return DATA from different sheet to multiple cells based on content of one cell

  1. #1
    Registered User
    Join Date
    11-19-2017
    Location
    Hallsville, Texas
    MS-Off Ver
    365
    Posts
    57

    Return DATA from different sheet to multiple cells based on content of one cell

    Hello,

    Sheet 1, I38 and I44 "CODE" corresponds to "Code" on sheet 2, Column A. Need VBA to automatically check both codes and return data from Sheet 2 to the appropriate cell on sheet 1. For example, Sheet 1, L38 should be filled with data from Sheet 2, column B. Sheet 1, X38 with Data from Sheet 2, Column C, etc.

    This is what I have so far
    Please Login or Register  to view this content.
    Obviously this code is pulled from a larger workbook. Sheet names are not correct.

    Please see attached book.

    Thanks
    Attached Files Attached Files
    Last edited by NullSpot; 02-14-2018 at 12:40 AM.

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    Try this

    Please Login or Register  to view this content.
    Kind regards
    Leo

  3. #3
    Registered User
    Join Date
    11-19-2017
    Location
    Hallsville, Texas
    MS-Off Ver
    365
    Posts
    57

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    Thanks! I changed Sheet 2 to Sheet 12, to reflect the actual sheet in my workbook. When I run it I get a "Subscript out of range" error and the debug stops on the "With Sheets ("Sheet12")" line.

  4. #4
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    Sure the name of sheet is Sheet12 ?

    if name is correct it works

    Kind regards
    Leo
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-19-2017
    Location
    Hallsville, Texas
    MS-Off Ver
    365
    Posts
    57

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    This is the actual document. When I type in a new number, I get the error.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-19-2017
    Location
    Hallsville, Texas
    MS-Off Ver
    365
    Posts
    57

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    Nevermind, I see what I was doing wrong. Thanks so much!!!!

  7. #7
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    yes yes different between sheet name and sheet index

    so if case is solved, can you mark as solved ?

    thanks
    Leo

  8. #8
    Registered User
    Join Date
    11-19-2017
    Location
    Hallsville, Texas
    MS-Off Ver
    365
    Posts
    57

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    Yes, I'll mark it solve. Care to decode what the Index( , 3) etc. means? I assume that they refer to cells. Just so I understand for the future.

  9. #9
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    i have no index (,3)
    i have used target.offset(,3) and this refers to 3 cells right from target cell
    so if target cell = A1 then Target.offset(,3) = cell D1 and target.offset(2,2) =cell C3 in this short exemple

    Kind regards
    Leo

  10. #10
    Registered User
    Join Date
    11-19-2017
    Location
    Hallsville, Texas
    MS-Off Ver
    365
    Posts
    57

    Re: Return DATA from different sheet to multiple cells based on content of one cell

    Yes, my apologies. I meant target.offset. Thanks for the explanation. It really is a different language!

    Ciao

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting cell content based on multiple columns of data (Vlookup? IndexMatch?)
    By markhooten in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-11-2017, 04:48 PM
  2. Return a value based on content from another cell
    By HeleneDelgado in forum Excel General
    Replies: 3
    Last Post: 04-14-2017, 03:46 PM
  3. Adding data from multiple cells into parts of another cell's content
    By robertmbt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2017, 05:59 AM
  4. looking up multiple cells to return a value in different cell/sheet
    By munroa1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-02-2014, 02:20 PM
  5. Select Multiple Cells at one time based on the lenght of the cell content
    By rajesraja in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2014, 10:39 AM
  6. Automatically copy cells content based on the content of another cell.
    By chrisbarlow1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2014, 11:13 AM
  7. [SOLVED] Fetch Data: Return Multiple Rows based on Cell Content
    By pdreyest in forum Excel General
    Replies: 8
    Last Post: 09-24-2012, 12:43 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1