+ Reply to Thread
Results 1 to 5 of 5

Copy & Paste + VLookup?

  1. #1
    Registered User
    Join Date
    12-05-2016
    Location
    Kampala, Uganda
    MS-Off Ver
    2013
    Posts
    2

    Copy & Paste + VLookup?

    Hello,

    I am trying to do a simple copy paste exercise. I am trying to copy data from columns B, C & D to columns H onwards based on whether the data in Column A matches Column G in order to create a mail merge file. Not gotten very far. Help would be appreciated!


    Here's what I've tried so far...


    Sub Macro5()
    '
    ' Macro5 Macro
    '
    ' Keyboard Shortcut: Ctrl+Shift+N
    '
    For x = 2 To 406
    If Cells(x, 1) = Cells(x, 7) Then
    Range(Cells(x, 2), Cells(x, 4)).Select
    Selection.Copy
    Cells(x, 7).Select
    Selection.End(xlToRight).Select
    ActiveCell.Offset(1).Select


    End If

    End If
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-01-2016
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    14

    Re: Copy & Paste + VLookup?

    Try this

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Copy & Paste + VLookup?

    If I'm understanding you correctly, you could do this with a formula. Use the formula below in H2. Array-confirm it with Ctrl + Shift + Enter instead of the regular Enter:

    =IFERROR(INDEX($B$2:$D$39,SMALL(IF($A$2:$A$39=$G2,ROW($A$2:$A$39)),CEILING(COLUMN(A:A)/3,1))-1,MOD(COLUMN(A:A)+2,3)+1),"")

    Fill down through H4, then fill right through BE2:BE4. When you adjust it for your regular data, just change the range to fit or exceed your data in column A.

    See the attachment if you get stuck.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-05-2016
    Location
    Kampala, Uganda
    MS-Off Ver
    2013
    Posts
    2

    Red face Re: Copy & Paste + VLookup?

    Thanks a lot Cantosh! Working great!

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Copy & Paste + VLookup?

    A vba option

    Please Login or Register  to view this content.
    Last edited by mike7952; 12-06-2016 at 02:48 AM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

+ 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. VBA, Vlookup, Copy, Paste and Clear
    By pp84 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-19-2013, 02:22 PM
  2. Help with VLOOKUP and Copy & Paste Macro
    By slny06 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2013, 09:03 AM
  3. Copy Paste VLOOKUP Formula
    By btamulis in forum Excel General
    Replies: 3
    Last Post: 10-30-2012, 03:07 PM
  4. VBA Macro to Copy and Paste a row Like a VLOOKUP
    By arlecchino in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2012, 05:10 AM
  5. Vlookup VBA copy and paste
    By ashleye in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-05-2011, 05:36 AM
  6. Excel 2007 : vlookup Copy & Paste
    By Alvan9 in forum Excel General
    Replies: 1
    Last Post: 08-14-2010, 01:49 PM
  7. VBA vlookup copy paste
    By Doolafs in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-20-2010, 12:55 PM
  8. Vlookup copy/paste
    By Nik in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2006, 12:48 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