Hi Chris,
How about this code? It allows you to select any delimiter you want and then writes the text file. Let me know if you have any problems.
Regards,
Daniel.
Sub SaveCustomDelimiter()
Dim strDelim As String, strFilePath As String, intFileNum As Integer
Dim vWriteData, lngRow As Long, lngCol As Long
Do
strDelim = InputBox("Please enter required delimiter.", "Delimiter")
If strDelim = "" Then Exit Sub 'User pressed cancel
If Len(strDelim) > 1 Then
MsgBox "Delimiter can only be one character long.", vbOKOnly, "Invalid delimiter"
End If
Loop Until Len(strDelim) = 1
'Now open a file and write the active sheet data to it
strFilePath = "C:\temp\anyname.txt"
intFileNum = FreeFile
Open strFilePath For Output As intFileNum
'Assign the active sheet data to an array to increase speed
vWriteData = ActiveSheet.UsedRange
For lngRow = 1 To ActiveSheet.UsedRange.Rows.Count
For lngCol = 1 To ActiveSheet.UsedRange.Columns.Count
Print #intFileNum, vWriteData(lngRow, lngCol); strDelim;
Next lngCol
Print #intFileNum,
Next lngRow
Close #intFileNum
End Sub
Awesome....exactly what I was looking for...thank you so much.
Chris