Results 1 to 10 of 24

Thread: Flexible Concatenation Function

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    or ?

    Code:
    Sub ConcatDashedRanges()
      Columns(1).replace "=","'="
    
      For Each Ar In Columns(1).SpecialCells(2).Areas
        Ar(1).Offset(, 1) = Application.Trim(Join(filter(filter(Application.Transpose(Ar.Value),"--",false),"'=",false), ";"))
      Next
    End Sub

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    15
    Quote Originally Posted by snb View Post
    or ?

    Code:
    Sub ConcatDashedRanges()
      Columns(1).replace "=","'="
    
      For Each Ar In Columns(1).SpecialCells(2).Areas
        Ar(1).Offset(, 1) = Application.Trim(Join(filter(filter(Application.Transpose(Ar.Value),"--",false),"'=",false), ";"))
      Next
    End Sub
    Your code does not appear to include the cells that started with the equal sign within the concatenated output from the macro (at least on my tests it doesnt').

  3. #3
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    14
    That's correct; they have been filtered out.
    You can remove the filter that does that: filter(...,"'=","")

Similar Threads

  1. UDF (user defined function) replacement for Excel's DATEDIF function
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 21
    Last Post: 03-07-2015, 09:47 PM
  2. FORMATTED Flexible Concatenation Function
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 1
    Last Post: 10-14-2012, 03:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •