Hi analystbank
Here's my version Try this
Sub WriteDataToTextFile()
'http://www.excelforum.com/excel-programming-vba-macros/1056069-save-notepad-through-vba-macro-having-copied-range-of-cells-pasted-into-notepad.html#post3934095
Dim MyFile As String, Rng As Range, CellValue As Variant, I As Integer, J As Integer
MyFile = "C:\elliot\M.txt"
Set Rng = Sheets("M").Range("S1:S200")
Open MyFile For Output As #1
For I = 1 To Rng.Rows.Count
For J = 1 To Rng.Columns.Count
CellValue = Trim(Rng.Cells(I, J).Value)
If J = Rng.Columns.Count Then
Print #1, CellValue
Else
Print #1, CellValue,
End If
Next J
Next I
Close #1
End Sub
Bookmarks