+ Reply to Thread
Results 1 to 10 of 10

Add a Col. to a Macro

  1. #1
    Registered User
    Join Date
    05-22-2019
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    66

    Add a Col. to a Macro

    Hello,
    The macro below copies col. C and O from the original sheet and create a new workbook with these two columns.. I would like to add col. P into the new workbook. Can someone edit this macro to make it copy col. P as well?

    Thank you.

    Please Login or Register  to view this content.

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

    Re: Add a Col. to a Macro

    See next code
    Adjust Const for your next modification

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

  3. #3
    Registered User
    Join Date
    05-22-2019
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    66

    Re: Add a Col. to a Macro

    Thank you. The problem is that your macro copies the formulas in col O & P, while what I need is actually the result of the formula.

    I hope this makes sense.

    Please see the attached Excel.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Add a Col. to a Macro

    First done your way

    Please Login or Register  to view this content.
    although I think more efficient and easier to understand is more like this

    Please Login or Register  to view this content.
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  5. #5
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Add a Col. to a Macro

    sorry forgot the sort.
    I imagine you dont have any problem with that but these 2 lines
    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,514

    Re: Add a Col. to a Macro

    If you are using array for your learning purpose then seethe code.
    Please Login or Register  to view this content.

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

    Re: Add a Col. to a Macro

    Thank you. The problem is that your macro copies the formulas in col O & P, while what I need is actually the result of the formula.
    So see next code
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-22-2019
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    66

    Re: Add a Col. to a Macro

    Thank you all for your help! This is an amazing forum. The macro works!

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

    Re: Add a Col. to a Macro

    You're welcome and thx for the rep

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,514

    Re: Add a Col. to a Macro

    Glad you like it and thanksbfor the rep.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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: 12-11-2019, 10:31 AM
  2. [SOLVED] macro showing error ( macro not found ) while trying to execute macro every 1 minute
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-16-2018, 07:58 PM
  3. [SOLVED] Define variable in macro than calling that macro inside another macro
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-21-2015, 10:58 AM
  4. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  5. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  6. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  7. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 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