Experts Exchange connects you with the people and services you need so you can get back to work.
Dim oFSObj As Object, strm As Object
Dim lngRow As Long, lngCol As Long
Dim rng As Range
Dim strTextFile As String, strDelimiter As String
strDelimiter = "|"
Set rng = ActiveSheet.UsedRange
strTextFile = "C:\Sidz.txt"
Set oFSObj = CreateObject("Scripting.FilesystemObject")
Set strm = oFSObj.CreateTextFile(strTextFile, True)
For lngRow = 1 To rng.Rows.Count
For lngCol = 1 To rng.Columns.Count
strm.Write Chr(34) & rng.Cells(lngRow, lngCol) & _
Chr(34) & strDelimiter
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Your question, your audience. Choose who sees your identity—and your question—with question security.