+ Reply to Thread
Results 1 to 9 of 9

Macro to add one column Left & adding formula from right

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    India
    MS-Off Ver
    MS 365
    Posts
    22

    Macro to add one column Left & adding formula from right

    Hi,

    I need help on creating a macro that adds a column before the last available column and copy the formula from the left column. Please see example worksheet. What I want is to add a new column after Z and before AA. And copy the formula from Z4,Z5,Z6 to the new column cells. See attached sample file.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Macro to add one column Left & adding formula from right

    Why ???????
    Simply insert a column and copy Z4,Z5,Z6 to new AA column ???

  3. #3
    Registered User
    Join Date
    11-14-2012
    Location
    India
    MS-Off Ver
    MS 365
    Posts
    22

    Re: Macro to add one column Left & adding formula from right

    Want this automated through macro without having to add manually.

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Macro to add one column Left & adding formula from right

    Use the macro recorder then?

    Moved to correct VBA forum

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to add one column Left & adding formula from right

    See next code
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  6. #6
    Registered User
    Join Date
    11-14-2012
    Location
    India
    MS-Off Ver
    MS 365
    Posts
    22

    Re: Macro to add one column Left & adding formula from right

    Thanks! This works. But, only issue is it is also copying the content of the entire column. Would be great if only the formula is copied and the input value of the cell is not. Is this possible?

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to add one column Left & adding formula from right

    Not sure to get it right.
    Using your file a column is added before last column AB: New column is AA.
    In this new column there is only formulas.
    See your file attached
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-14-2012
    Location
    India
    MS-Off Ver
    MS 365
    Posts
    22

    Re: Macro to add one column Left & adding formula from right

    Thanks again! See example, inserting the column is also adding the column. Of course since the macro is copying the entire column so along with the formula if there are any data they are getting added too.
    Attached Files Attached Files
    Last edited by maxi0009in; 03-22-2020 at 11:00 PM.

  9. #9
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to add one column Left & adding formula from right

    You're welcome
    If all is OK then close the thread

+ 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. Replies: 6
    Last Post: 06-26-2017, 09:04 PM
  2. Replies: 6
    Last Post: 03-04-2013, 11:25 AM
  3. [SOLVED] Macro to autofill formula down to length of adjacent column to the left
    By jacobadger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2012, 08:28 PM
  4. Replies: 0
    Last Post: 08-14-2012, 09:42 AM
  5. macro to find first blank cell in a column cut the value from left adjacent column
    By willykin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-01-2012, 09:23 AM
  6. macro code for adding a cell in left of original cell?
    By gkeith in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-29-2010, 03:30 PM
  7. Macro to search column with last value and insert TOTAL column to the left
    By sbara906 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-02-2009, 11:34 AM

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