title: How to create an excel function that outputs the content of a range of cells
body: <p>I am trying to create an excel function that concatenates the text contained within a range of cells C4:K9.</p>
  
  <p>Although the code below concatenates the text within the range of cells, I am not successful in inserting a carriage return (vbCrLF) between each row. So when I type the function in the cell I wish to see the output value, I want it to be contents of C4:K4, carriage return, C5:K5, carriage return, and so forth until C9:K9 all in one cell.</p>
  
  <pre><code>Function Join(rng As Range, delimiter As String) As String
  Dim cell As Range, rowIndex As Long
   For rowIndex = 1 To rng.Rows.Count
     For Each cell in rng(cells(rowIndex,3), cells(rowIndex,11))
      Join = Join &amp; cell.Text &amp; delimiter
     Next cell
     Join = Left(Join, Len(Join) - Len(delimiter)) &amp; vbCrLF
   Next rowIndex
  End Function
  </code></pre>
  
  <p>Does anybody have any ideas as to how to make this function work?</p>