+ Reply to Thread
Results 1 to 8 of 8

Copy / Paste Different Columns from One Sheet to Another

  1. #1
    Registered User
    Join Date
    10-09-2012
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2020
    Posts
    45

    Copy / Paste Different Columns from One Sheet to Another

    Hi everyone,

    I'm very new to VBA and am trying to learn. I have worked out a few things, but this is way over my head. I will post an example if it's necessary, but I think I can explain it well enough that it's not necessary.

    I'd like to take a copy / paste the values from a few columns from the "Requirements" tab and paste them to the "Enrollment" tab if they meet a certain criteria. The columns from "Requirements" that I'd like copied are Col A, N, R, BD, and BE. I'd like them to be pasted in Col J, K, L, M, N (J:N) on the "Enrollment" tab, if anything in Col O of "Requirements" tab equals the value in "Enrollment!$D$5".

    Please let me know if there needs to be further explanation. Hopefully, I could get away with not posting an example as there is a lot of client sensitive data on it and would take a while to remove. Thanks in advance!

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

    Re: Copy / Paste Different Columns from One Sheet to Another

    With out looking at your data, it is difficult to test it, but try this code.
    I am making few assumptions: You have a header on both sheets in row 1, so you are copying from row 2 to last row and also have headers on the destination tab

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-09-2012
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2020
    Posts
    45

    Re: Copy / Paste Different Columns from One Sheet to Another

    Thanks, @AB33, but I'm having some issues with that code. I finally got around to removing all the extra data and have attached the example inline. Let me know if you have any other questions / comments. Thanks!

    Copy_Paste_Multiple_Col_Example.xlsx

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

    Re: Copy / Paste Different Columns from One Sheet to Another

    ccowman,
    Okay! I see what the issues are.
    1. Your sheet name is not actually "Enrollment", but Enroll. This obvioulsy would give you an error.
    2. On tab sheet "Enroll" Range D5 is not Team, but Test 4, and the names you have in column O is Team, so one of them must be wrong. Since you have team names in Column O, I suspect the range value in D might be Team 4, not Test 4
    And lastly, you wish to copy the columns starting row 7,column J, Am I right? Please confirm this and code will be on its way

  5. #5
    Registered User
    Join Date
    10-09-2012
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2020
    Posts
    45

    Re: Copy / Paste Different Columns from One Sheet to Another

    Sorry about that @AB33! I guess I should have just attached this from the beginning and prevented all the hassle / back and forth. LESSON LEARNED!

    To answer your questions, I changed the tab from "Enrollment" to "Enroll" to save a few characters in typing. Sorry, D5 should say "Team 4" - that's a mistype by me. Yes, I would like to start the pasting in Row 7. I plan to have some header data at the top.

    Thanks again for all the help!

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

    Re: Copy / Paste Different Columns from One Sheet to Another

    Okay! this should do
    Please Login or Register  to view this content.
    Last edited by AB33; 01-16-2013 at 05:59 PM.

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

    Re: Copy / Paste Different Columns from One Sheet to Another

    Forget to format dates. Please see amended code post 6

  8. #8
    Registered User
    Join Date
    10-09-2012
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2020
    Posts
    45

    Re: Copy / Paste Different Columns from One Sheet to Another

    Awesome! Works perfectly, @AB33! Thanks!

+ 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