+ Reply to Thread
Results 1 to 11 of 11

Retrieve product information from another sheet

  1. #1
    Registered User
    Join Date
    11-23-2016
    Location
    England
    MS-Off Ver
    2013
    Posts
    16

    Question Retrieve product information from another sheet

    Hi, I'm having some trouble getting started with a macro I need.
    The macro will use the code from sheet 1 and match it up with the code on sheet 2 (they will not be in the same order) and it will then pull the information about the product from sheet 2 to sheet 1.

    Could anyone please help me out?

    *Attachment in a post below
    Last edited by Zed1; 12-08-2016 at 12:57 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,422

    Re: Retrieve product information from another sheet

    You can do it with a simple formula - put this in B1 of Sheet1:

    =IFERROR(VLOOKUP($A1,Sheet2!$A:$C,COLUMNS($A:B),0),"")

    then copy across and down as required.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-23-2016
    Location
    England
    MS-Off Ver
    2013
    Posts
    16

    Re: Retrieve product information from another sheet

    Oh my apologies, the example wasn't quite correct. On sheet 1 the item codes would be horizontal instead of vertical so Vlookup can't work here.
    I'd really prefer it to be in VBA if possible as I'll also be using other bits of code to edit it.

  4. #4
    Registered User
    Join Date
    11-23-2016
    Location
    England
    MS-Off Ver
    2013
    Posts
    16

    Re: Retrieve product information from another sheet

    So it'd be like this, except with hundreds of records
    Attached Files Attached Files

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,422

    Re: Retrieve product information from another sheet

    You could use this formula in A2 of Sheet1:

    =IFERROR(VLOOKUP(A$1,Sheet2!$A:$C,ROWS($1:2),0),"")

    then copy across and down as required. Note: VLOOKUP is still used, as your source data is still arranged vertically, even though you want the output to be horizontal.

    Sorry, I rarely write macros anymore - maybe someone else will chip in.

    Hope this helps.

    Pete

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Retrieve product information from another sheet

    If you want a code.
    Attached Files Attached Files

  7. #7
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: Retrieve product information from another sheet

    Here you go. Hope it helps
    Attached Files Attached Files
    Please consider:
    Be polite. Thank those who have helped you.
    Click the star icon in the lower left part of the contributor's post and add Reputation. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

  8. #8
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: Retrieve product information from another sheet

    AB33,
    Can you please explain the logic of your code. I haven't seen a transpose code like that until now.

    I don't understand this part.

    Please Login or Register  to view this content.
    Thank you,
    Ionut

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Retrieve product information from another sheet

    Which part? You copied the entire code. Transpose works the same as excel's transpose function. It flips over the rows in to columns and vice versa.

  10. #10
    Registered User
    Join Date
    11-23-2016
    Location
    England
    MS-Off Ver
    2013
    Posts
    16

    Re: Retrieve product information from another sheet

    Quote Originally Posted by AB33 View Post
    If you want a code.
    This is working great, thankyou very much!

    Also thanks to IonutC and Pete_UK for attempting this as well
    Last edited by Zed1; 12-08-2016 at 01:24 PM.

  11. #11
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: Retrieve product information from another sheet

    yeah i know...each line of your code. if you are busy, no worries.

+ 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. program/macro that can retrieve images of the product from the internet
    By Chetan_raghu in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-01-2016, 06:23 PM
  2. Replies: 2
    Last Post: 10-03-2014, 07:39 PM
  3. [SOLVED] I need to automatically retrieve data relating to a product code upon entry.
    By Kylemarc in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-12-2013, 09:21 AM
  4. Matching information from a product feed and importing it into another excel sheet
    By SinksUS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2013, 08:36 PM
  5. can column retrieve information based on another sheet's column
    By tanglin10 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2013, 08:12 AM
  6. [SOLVED] Find Product Details in Another Sheet based on Product ID and Copy some Fields From there
    By kevalkothari in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2012, 10:43 AM
  7. retrieve information
    By just1creation in forum Excel General
    Replies: 1
    Last Post: 10-26-2006, 02:46 PM

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