+ Reply to Thread
Results 1 to 15 of 15

Macro to insert formula and fill down to last row

  1. #1
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Macro to insert formula and fill down to last row

    I need a macro that will insert this formula: =Trim(IF(B3="","",MID(B3&", "&B3,FIND(" ",B3)+1,LEN(B3)+1))) into column C starting on row three through the end of the spreadsheet information.

    Thank you

    ADDENDUM:

    I typed this incorrectly when I first posted. I need it to fill down into only column C not the end of the spreadsheet. The below macro is really close but I don't have enough knowledge to change it to do what I need. Please advise. Thank you
    Last edited by redzan; 05-21-2014 at 11:03 PM.

  2. #2
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Macro to insert formula and fill down to last row

    Hi there,
    which column is "the master column" - that is occupated from row 3 to the end?
    Regards
    Miroslav R.

    (If You like my solutions, feel free to add reputation.)

  3. #3
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to insert formula and fill down to last row

    Column B is where the information is that the formula uses to reformat into column C. Is that what you mean?

  4. #4
    Valued Forum Contributor Miroslav R.'s Avatar
    Join Date
    05-16-2013
    Location
    NMnV, Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    479

    Re: Macro to insert formula and fill down to last row

    Try this one

    Please Login or Register  to view this content.
    Replace
    Please Login or Register  to view this content.
    with the sheet name You want the formula to be in.

    Hope it helps

  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 insert formula and fill down to last row

    Try, if it's not OK send a sample of yor file
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to insert formula and fill down to last row

    I apologize. I wrote my first post incorrectly. I need the formula to fill down only in column C. PCI yours worked but messed up my columns to the right of C.

  7. #7
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to insert formula and fill down to last row

    This is really close to what i need. Please read first post with addendum. I don't have enough knowledge to fix the above macro to what I actually need. Thank you

  8. #8
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,498

    Re: Macro to insert formula and fill down to last row

    Maybe (try on a copy of your original)

    Please Login or Register  to view this content.
    Last edited by jolivanes; 05-22-2014 at 12:41 AM.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to insert formula and fill down to last row

    Another:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to insert formula and fill down to last row

    Thank you Jolivanes! It worked perfect! Can you please do the same thing for this one? Information is in column E with reformat in column F.

    Here is my formula: =TRIM(IF(E3="","",MID(E3&" "&E3,FIND(",",E3)+2,LEN(E3)-1)))

    I can start a new thread if needed but it is the exact same thing with a different formula in a different column. It converts last, first to first last.

    Thanks again for your time on this.

  11. #11
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,498

    Re: Macro to insert formula and fill down to last row

    Both formulae in one go I assume.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to insert formula and fill down to last row

    Thanks for all the help. This is running perfectly!

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

    Re: Macro to insert formula and fill down to last row

    Last run
    Remove next statement
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to insert formula and fill down to last row

    I've marked this solved but I have a very similar problem today that I need help with. I tried to manipulate the above with no luck.

    I need a macro for this formula put in column F and filled down.
    =IF(ISNA(VLOOKUP(F3,'C:\Users\RoseAnn\Desktop\[credentials.xls]Sheet1'!$A$2:$B$2658,2,FALSE)),F3,VLOOKUP(F3,'C:\Users\RoseAnn\Desktop\[credentials.xls]Sheet1'!$A$2:$B$2658,2,FALSE))

  15. #15
    Registered User
    Join Date
    05-12-2013
    Location
    Utah
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to insert formula and fill down to last row

    Never mind that last post. I did it myself! Thanks for teaching me guys.

+ 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. Macro to insert rows and fill it with info from above
    By waven in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2014, 04:08 AM
  2. How to insert a row using a macro, that follows the auto fill rule
    By rhyssmith92 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2013, 12:04 PM
  3. [SOLVED] Macro to conditionally insert rows and fill them
    By dproth in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2013, 09:48 AM
  4. How to insert a row and fill in missing data with macro
    By Catherine7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2010, 07:49 PM
  5. Macro to insert row/fill cells
    By manny_cb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2008, 06:46 PM

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