Quote Originally Posted by snb View Post
Sub M_snb()
  sn = Filter(Split(Replace(Replace(Cells(1), "!", "!."), "?", "?."), "."), " ")
  Cells(1, 2).Resize(UBound(sn)) = Application.Transpose(sn)
End Sub
Is it possible to get the data from the text file? Thank you for transpose idea. But this macro removing "Punctuation Marks". I want to keep them.


Quote Originally Posted by p45cal View Post
Select the cell(s) with the original text (I've assumed they're in one column) then run this macro. New 'sentences' will appear in the cells to the right, filling as many cells as needed, but keeping the original cell(s) intact.
Sub blah()
For Each cll In Selection.Cells
  bt = Application.Trim(cll.Value)
  at = Replace(Replace(Replace(Replace(bt, "...", "…¬"), ".", ".¬"), "?", "?¬"), "!", "!¬")
  at2 = Split(at, "¬")
  For i = LBound(at2) To UBound(at2)
    at2(i) = Application.Trim(at2(i))
    at2(i) = Replace(at2(i), "…", "...")    'optional to replace an ellipsis with 3 dots.
    If Len(at2(i)) = 0 Then at2(i) = "¬"
  Next i
  at3 = Filter(at2, "¬", False)
  cll.Offset(, 1).Resize(, UBound(at3) - LBound(at3) + 1).Value = at3
Next cll
End Sub
Is it possible to get the data from the text file? And how can we add "transpose"?