+ Reply to Thread
Results 1 to 4 of 4

Help writing an easy VBA script - copying every nth column and inserting it next to it

  1. #1
    Registered User
    Join Date
    09-26-2012
    Location
    lewisville
    MS-Off Ver
    office 2010
    Posts
    2

    Question Help writing an easy VBA script - copying every nth column and inserting it next to it

    I would consider myself an advanced excel user, except I don't know anything about vba. I would appreciate your guys expertise in helping me get this done!

    I have created a huge financial model and had it set up for 11 years, corresponding to 11 consecutive columns of equations. I need to add 2 extra columns at the end of each set of 11 columns.


    Please see attachment...looking for a macro to able to run that would allow me to select a column letter to start (in this case column O:O), then it would go over to the end of the block of 11 columns (column Y:Y), copy that last column, and insert it twice after (after column Y:Y), then repeat this process with the next block of 11 columns until the last column in the worksheet (column AAD:AAD).

    The attached example is only one of many worksheets that i need to add 2 columns to...so being able to run this macro on different tabs is crucial. Maybe to make it easier, I could inset a row at the top of the workbook, and put an "x" in the columns that needs duplicated twice to the left of it?


    Thanks for your help!

    -Rob
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Help writing an easy VBA script - copying every nth column and inserting it next to it

    This should do the trick for you.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    09-26-2012
    Location
    lewisville
    MS-Off Ver
    office 2010
    Posts
    2

    Re: Help writing an easy VBA script - copying every nth column and inserting it next to it

    haripopuri, thanks for your help, much appreciated!

  4. #4
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: Help writing an easy VBA script - copying every nth column and inserting it next to it

    Pls update thread as solved if this resolves the query. 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