+ Reply to Thread
Results 1 to 2 of 2

Adding complicated CONCATENATE formula to range in column

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    Here
    MS-Off Ver
    Excel 2013
    Posts
    16

    Adding complicated CONCATENATE formula to range in column

    Hello everyone,

    I am trying to implement a bit of code that adds a very hairy concatenate formula to a range of cells in a column, but running into a bunch of issues with quotation marks in VBA. The normal formula is as follows:

    =CONCATENATE("Print ""<val>",G5,",",F5,",","""",";",$L$5,"\",A5,IF(L5=A5,"","\" & B5),"\",C5,";""</val>""")

    Normally, I would try to do something utilizing R1C1 notation to update the relative references of the cells (above, you see that everything is looking at Row 5). I'm trying to manage all of the quotation marks floating around that need to show up in the final string, so here is my following code that is producing errors.

    Please Login or Register  to view this content.
    Perhaps I am going about a very poor way of doing this? Maybe there is a better alternative to R1C1 notation for this scenario? Does anyone have any suggestions for handling long strings like this and accounting for the quotation marks that should be included in the final string?

    Thank you

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,522

    Re: Adding complicated CONCATENATE formula to range in column

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Adding criteria to a complicated SUMPRODUCT formula
    By Sinnie in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2013, 01:57 PM
  2. Complicated formula for a range of cells
    By Dyda in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-18-2013, 12:25 PM
  3. Adding a count to concatenate range function
    By mbus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-12-2013, 11:18 PM
  4. Trouble adding an IF to a fairly complicated formula
    By AllenMead in forum Excel General
    Replies: 1
    Last Post: 09-29-2010, 07:55 AM
  5. Adding something to a complicated formula
    By Roz in forum Excel General
    Replies: 7
    Last Post: 12-20-2005, 05:10 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