+ Reply to Thread
Results 1 to 3 of 3

macro to add columns after existing columns and copy/paste headers and formulas

  1. #1
    Registered User
    Join Date
    01-16-2012
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2010, Office for Mac 2011
    Posts
    22

    macro to add columns after existing columns and copy/paste headers and formulas

    Hi All!

    I need some help with a macro I've been attempting and failing at. I have a workbook with more than a few worksheets that all are the same. I am needing to insert 6 columns between existing columns so that I can put formulas into these new columns. I've attached a sample workbook with two tabs to show what I'm doing currently and what I'm looking for the result to be (at least with respect to the additional columns) The rough start I have is this :

    Please Login or Register  to view this content.
    Am I going in the right direction or completely down a rabbit hole? thanks for all of the help! assistance is much appreciated! sample.xlsx

  2. #2
    Registered User
    Join Date
    01-16-2012
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2010, Office for Mac 2011
    Posts
    22

    Re: macro to add columns after existing columns and copy/paste headers and formulas

    Ok, so I've changed tactics a bit from the above. Hopefully someone else will benefit from my trial and error. Unfortunately all of my sheets that contain columns have a different number of existing columns to insert the six new columns I need. My current tab looks like this

    Date Column Time Column Column 1 Column 2 Column 3 etc.

    I need to get to :

    Date Column Time Column Column 1 Insert a Insert b Insert c Insert d Insert e Insert F Column 2 Insert a....etc .

    Headers are easy, I can just set them equal to the first set of headers so if they change, it will change all of them. Is there an easier/cleaner way to do the code than this?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to add columns after existing columns and copy/paste headers and formulas

    Hi rhybeka

    Try this
    Please Login or Register  to view this content.
    Last edited by jaslake; 08-21-2013 at 02:44 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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] Match, Copy and Paste Column Headers - varying number of columns
    By itcher in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-19-2013, 10:49 AM
  2. Replies: 11
    Last Post: 05-04-2012, 09:11 AM
  3. Copy data under specific columns in sheet1 n paste to sheet2 under the same headers
    By ShyamEXcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-08-2012, 02:15 PM
  4. Excel 2007 : Macro to copy columns based headers
    By rls1316 in forum Excel General
    Replies: 2
    Last Post: 04-25-2011, 10:22 PM
  5. Macro for comparing headers and copy/pasting respective columns
    By Sarushka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2009, 08:48 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