+ Reply to Thread
Results 1 to 7 of 7

Copy columns and paste them in another sheet every nth columns

  1. #1
    Registered User
    Join Date
    05-15-2018
    Location
    Dublin, Ireland
    MS-Off Ver
    2016
    Posts
    5

    Copy columns and paste them in another sheet every nth columns

    Hi all,

    I am very new to VBA and I am trying to do something that I am sure is possible, but I couldn't find what I want in any of the forums.
    This is my first post (ever), so if I might miss some information.

    Basically I just want to copy the columns on one sheet (A to ...) and paste them in another sheet (in the same workbook), but every 4 columns, starting from column D.

    Can anyone help me on this?

    Thanks.


    PS: English is not my mother tongue so my apologies if there are any mistakes that may burn your eyes .
    Last edited by johnjohnk; 05-16-2018 at 03:42 PM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Copy columns and paste them in another sheet every nth columns

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,896

    Re: Copy columns and paste them in another sheet every nth columns

    try this:

    O
    Please Login or Register  to view this content.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    05-15-2018
    Location
    Dublin, Ireland
    MS-Off Ver
    2016
    Posts
    5

    Re: Copy columns and paste them in another sheet every nth columns

    Thanks for your help.

    xladept: Here is the excel sheet. Sheet 1 shows the data that I want to be paste in sheet 2 every 4 columns, as I manually did here.

    alansidman: I tried your code but it seems to only copy the first column
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,896

    Re: Copy columns and paste them in another sheet every nth columns

    I've applied the code I provided to your worksheet and after deleting the first row of your sample data, it worked for me. Row 1 was blank and the code looks to that row to determine the number of columns to copy.

  6. #6
    Registered User
    Join Date
    05-15-2018
    Location
    Dublin, Ireland
    MS-Off Ver
    2016
    Posts
    5

    Re: Copy columns and paste them in another sheet every nth columns

    Thanks for your help!!! That's all I needed !

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,896

    Re: Copy columns and paste them in another sheet every nth columns

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Copy columns to last row and paste in new sheet
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-17-2014, 01:11 PM
  2. Macro to Copy from 2 Columns, Paste Value in the next 2 Columns, Then clear 1st Columns
    By MHALTTUNEN in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2014, 03:34 PM
  3. [SOLVED] Help me copy & Paste columns from one sheet to another
    By gm2612 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-27-2013, 07:19 AM
  4. Replies: 8
    Last Post: 04-04-2013, 08:02 PM
  5. [SOLVED] Copy / Paste Different Columns from One Sheet to Another
    By ccowman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-16-2013, 06:02 PM
  6. [SOLVED] Search Copy and Paste two columns in different sheet
    By mahtabshaikh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2012, 01:26 PM
  7. Replies: 2
    Last Post: 02-22-2011, 02:07 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