+ Reply to Thread
Results 1 to 9 of 9

Macro to find SKU in column; then copy data in row and paste special (values)

  1. #1
    Registered User
    Join Date
    09-02-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    25

    Macro to find SKU in column; then copy data in row and paste special (values)

    Hi all

    I'm trying to do the following:

    I have a list of SKU's in column D, descriptions in column E and data in Column F and G

    I want to build a macro that finds a SKU that I punch in to a cell (D1), to then search the column of D (2:58) for this SKU, and copy the data from Column G (Which is a vlookup) and 'paste special values' into Column F.

    The SKU in cell D1 will change, which is why it will need to probably index search through the column of D, but I've tried a number of times and simply cannot get it to work.

    Any help would be wonderful

    Starkey
    Last edited by Starkey; 09-12-2012 at 10:06 PM.

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    Hi Starkey,

    Do you really need a macro as won't this formula in cell F1 do the job?:

    =IFERROR(VLOOKUP(D1,$D$2:$G$58,4,FALSE),"")

    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    09-02-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    Hi Robert,

    I think I do need the macro, as there will already be data in column F. When I make changes to Column G (Which flows through from another sheet), I need to then permanently record the change in Column F, hence the copy and paste special values element.

    Cheers,

    Starkey

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    Could you please upload a workbook with a before and after scenario (devoid of all sensitive information) and I'll see what I can do.

  5. #5
    Registered User
    Join Date
    09-02-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    Example is attached, thanks Robert.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    Hi Starkey,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert

  7. #7
    Registered User
    Join Date
    09-02-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    Hi Robert!

    Thank you so much. That works exactly the way I want it to. The trick is now incorporating it into my spreadsheet, but I'm sure that will be fairly easy

    Many thanks!

    Starkey

  8. #8
    Registered User
    Join Date
    09-02-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    EDIT

    Hi Rob, no matter. I worked through your code and discovered how to adjust it accordingly.

    Thank you so much again, this will be really helpful!

    Starkey

    ---

    Hi Robert,

    Sorry if I'm pushing my luck here, but is it also possible to pull the data from just the 'Before' sheet? In essence, the 'Data' tab is pulling from a number of different sheets in my spreadsheet, so that's not a viable option ongoing.

    Cheers,

    Starkey
    Last edited by Starkey; 09-12-2012 at 10:30 PM.

  9. #9
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Macro to find SKU in column; then copy data in row and paste special (values)

    Hi Starkey,

    I'm glad to have helped and thanks for marking the thread as solved (and for adding to my reputation )

    Kind regards,

    Robert

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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