Is there a way to save as an excel file containing a list of words inone column so when I open it in Notepad I get the words in one line separated by commas?
Thanks
Is there a way to save as an excel file containing a list of words inone column so when I open it in Notepad I get the words in one line separated by commas?
Thanks
Welcome to the forum.
See http://www.excelforum.com/excel-prog...le-string.html
Entia non sunt multiplicanda sine necessitate
Thank you,
Is there a way to directly export it from Excel?
You can save as CSV, but then you get CR/LF between rows.
shg,
I am not much of a programer. how do you run the program in
http://www.excelforum.com/excel-prog...le-string.html
Thanks again
Adding a Macro to a Code Module![]()
Sub TextOut() Const sFile As String = "C:\YourPath\YourFileName.txt" ' change as required Dim cell As Range Dim iFF As Integer Dim s As String For Each cell In Selection s = s & cell.Value & "," Next cell s = Left(s, Len(s) - 1) iFF = FreeFile Open sFile For Output As #iFF Print #iFF, s; Close #iFF End Sub
1. Copy the code from the post
2. Press Alt+F11 to open the Visual Basic Editor (VBE)
3. From the menu bar in the VBE window, do Insert > Module
4. Paste the code in the window that opens
5. Edit the sFile string to be the correct path
6. Close the VBE to return to Excel
Then ...
Select the cells you want to output to the file
Do Alt+F8 and run macro TextOut
shg,
Worked like a charm, thanks very much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks