+ Reply to Thread
Results 1 to 7 of 7

Use VBA code to copy and paste a specific selection

  1. #1
    Registered User
    Join Date
    07-30-2013
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    32

    Use VBA code to copy and paste a specific selection

    Hi everyone,

    I am trying to find out how to write a vba code that will copy individual rows that have ID codes (in column D) that do not match the master list of ID codes on sheet "ID Codes" column A. Then I need to paste the copied rows into a new sheet called "print sheet" in the next availbe row. Any ideas as to how I would even start this???

    Thanks!

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Use VBA code to copy and paste a specific selection

    Please Login or Register  to view this content.
    Untested.

    e/ I forgot to mention. You'll have to change Search Codes here:
    Please Login or Register  to view this content.
    To the name of the worksheet you're searching from.
    Last edited by Solus Rankin; 08-08-2013 at 02:36 PM.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    07-30-2013
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Use VBA code to copy and paste a specific selection

    IT works well the only problem is pastes the rows into a new sheet instead of my "Print Sheet", also it only copied the same row from the bottom of my list instead of just the row from the top. Any ideas??

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Use VBA code to copy and paste a specific selection

    If Print Sheet already exists (I thought you wanted a new sheet) then change this:
    Please Login or Register  to view this content.
    to this:
    Please Login or Register  to view this content.
    I'm not sure which list you're speaking of or what is in the bottom/top row. Is there an example workbook you could attach with a before and after? This would aid in coming up with a complete solution. To attach a workbook, press the 'Go Advanced' button below, and then the paperclip icon in the tool bar.

  5. #5
    Registered User
    Join Date
    07-30-2013
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Use VBA code to copy and paste a specific selection

    I have attatched the workbook

    Concat.xlsm

  6. #6
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Use VBA code to copy and paste a specific selection

    I noticed the ID Codes on the Notes tab are on there multiple times, therefore they will get copied multiple times.

    Try:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-30-2013
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Use VBA code to copy and paste a specific selection

    I updated what Im trying to accomplish

    Concat.xlsm

  8. #8
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Use VBA code to copy and paste a specific selection

    Please Login or Register  to view this content.

+ 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. Replies: 0
    Last Post: 07-16-2013, 05:22 AM
  2. VBA Code to copy and paste a row depending on selection made in a combobox
    By ssu in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-20-2013, 05:37 AM
  3. Macro to copy specific line from text file and paste into specific cell in excel
    By keeneye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:35 AM
  4. Selection Change code greys out paste option
    By bradlehoux in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2011, 01:27 PM
  5. Error on code to copy and paste user selection.
    By leaning in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2011, 10:52 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