+ Reply to Thread
Results 1 to 9 of 9

Macro to insert n columns every nth column

  1. #1
    Registered User
    Join Date
    07-03-2013
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Post Macro to insert n columns every nth column

    I need a macro written that I will help me add 6 columns every other column beginning at column F. I have tried to edit the other macros in this forum, but I am having trouble understanding them enough to fit my needs.

    Any help is appreciated.

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Macro to insert n columns every nth column

    for example:
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

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

    Re: Macro to insert n columns every nth column

    Please Login or Register  to view this content.
    Last edited by AB33; 07-03-2013 at 04:58 PM.

  4. #4
    Registered User
    Join Date
    07-03-2013
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to insert n columns every nth column

    Unfortunately this added 1 column every 6 columns rather than 6 columns every other column. Wasn't sure what changes to make to fix it. Thanks for the reply.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,199

    Re: Macro to insert n columns every nth column

    Hi, kreese,

    start from the right and work backwards towards F:

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Registered User
    Join Date
    07-03-2013
    Location
    Virginia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to insert n columns every nth column

    Quote Originally Posted by tehneXus View Post
    for example:
    Please Login or Register  to view this content.
    Unfortunately this added 1 column every 6 columns rather than 6 columns every other column. Wasn't sure what changes to make to fix it. Thanks for the reply.

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

    Re: Macro to insert n columns every nth column

    I noticed I made a mistake looping forward, instead of back word. Holger's comment alerted me.

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

    Re: Macro to insert n columns every nth column

    "add 6 columns every other column beginning at column F"
    To me means insert 6 columns every other columns(Jump) one column, starting from column 6.

  9. #9
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Macro to insert n columns every nth column

    AB33, I agree.

    Please Login or Register  to view this content.
    Last edited by tehneXus; 07-03-2013 at 05:36 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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