title: VBA Excel replace line breaks in a cell
body: <p>I would need to replace the line breaks in a cell, with a line break and the content of a cell in the same column of the active cell.</p>
  
  <p>The code would be something like this:</p>
  
  <pre><code> For i = LBound(arColumns) To UBound(arColumns)
     'ActiveColumn = arColumns(i)
     Set rng = Range(arColumns(i))
  
     For Each Cell In rng.Cells
       If Cell.row &gt; 4 And Cell.row &lt; r Then
         colnum=cell.column
         Cell.value = "{Something}" &amp; Cells(3, colnum).value &amp; _
             ", text here{/something}" &amp; Cell.value  'First line in the cell
         cell.replace what:=vbCrLf, replacement:=vbCrLf &amp; "{Something}" &amp; _
             Cells(3, colnum).value &amp; ", text here{/something}" 'First try
         Cell.value = Application.WorksheetFunction.Substitute(CStr(Cell.value), vbCrLf, vbCrLf &amp; _
             "{maxlen}{/maxlen}{notes}" &amp; ", No Max length{/notes}")  'Second try
       End If
     Next
   Next
  </code></pre>
  
  <p>I've tried to replace the values of the line breaks with the two methods, replace and substitute. None of them have been working or I am doing something wrong with this block of code.</p>
  
  <p>The array arColumns have the range of columns that I want to work, for example: B:C,E:E,M:O,Z:AB...</p>