+ Reply to Thread
Results 1 to 5 of 5

Macro to combine multiple cell formulas

  1. #1
    Registered User
    Join Date
    06-05-2012
    Location
    Milwaukee
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro to combine multiple cell formulas

    Hi,

    I am new to the VBA world and at lost I need help with the following:

    I would like to have the freedom of selecting multiple cells, and have the LAST cell in this multicell selection combine the formulas contained in each of the cells selected (feel free to ignore what is already contained in the LAST cell). Formulas would need to be seperated by the '+' sign

    Please kindly advise. Much appreciated.

    Ameer
    Last edited by ameerhamzauk; 06-05-2012 at 03:31 PM.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Macro to combine multiple cell formulas

    Try this:
    Please Login or Register  to view this content.
    Last edited by tlafferty; 06-05-2012 at 01:44 PM. Reason: incorrect code tag
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Registered User
    Join Date
    06-05-2012
    Location
    Milwaukee
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to combine multiple cell formulas

    Many thanks for the swift response

    Quick follow up: wouldn't 'C' need be declared as object or range or something becaaue currently I am getting an invalid property/argument error.

    Thanks!

  4. #4
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Macro to combine multiple cell formulas

    C is just shorthand for a variable which is dimensioned when the for next loop starts. It could as easily be cll or some other text value. Be sure that your last selection is an empty cell, and that the other cells in your selection contain a formula, then try running it again. I'm not getting an error. See attached.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-05-2012
    Location
    Milwaukee
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to combine multiple cell formulas

    yes it work!

    Many thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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