title: Split rows that have multiline text and single line text
body: <p>I'm  trying to figure out how to split rows of data where columns B,C,D in the row contain multiple lines and others do not.  I've figured out how to split the multi-line cells if I copy just those columns into a new sheet, manually insert rows, and then run the macro below (that's just for column A), but I'm lost at coding the rest. </p>
  
  <p>Here's what the data looks like:
  <img src="https://i.stack.imgur.com/Y0Y5p.png" alt="enter image description here"></p>
  
  <p>So for row 2, I need it split into 6 rows (one for each line in cell B2) with the text in cell A2 in A2:A8.  I also need columns C and D split the same as B, and then <strong>columns E:CP</strong> the same as column A.</p>
  
  <p>Here is the code I have for splitting the cells in columns B,C,D:</p>
  
  <pre><code>Dim iPtr As Integer
  Dim iBreak As Integer
  Dim myVar As Integer
  Dim strTemp As String
  Dim iRow As Integer
  iRow = 0
  For iPtr = 1 To Cells(Rows.Count, col).End(xlUp).Row
      strTemp = Cells(iPtr1, 1)
      iBreak = InStr(strTemp, vbLf)
      Range("C1").Value = iBreak
          Do Until iBreak = 0
          If Len(Trim(Left(strTemp, iBreak - 1))) &gt; 0 Then
              iRow = iRow + 1
              Cells(iRow, 2) = Left(strTemp, iBreak - 1)
          End If
          strTemp = Mid(strTemp, iBreak + 1)
          iBreak = InStr(strTemp, vbLf)
      Loop
      If Len(Trim(strTemp)) &gt; 0 Then
          iRow = iRow + 1
          Cells(iRow, 2) = strTemp
      End If
  Next iPtr
  End Sub
  </code></pre>
  
  <p>Here is a link to an example file (note this file has 4 rows, the actual sheet has over 600):  <a href="https://www.dropbox.com/s/46j9ks9q43gwzo4/Example%20Data.xlsx?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/46j9ks9q43gwzo4/Example%20Data.xlsx?dl=0</a> </p>