Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've written some VBA that populates data in a spreadsheet, then
combines the data so that there's only data in the first column and each row in the first column is one string of data. I need to save it as a textfile, but I'm having two problems with this. I can't seem to save it without a .txt extension being added to the filename.. Secondly, one of the cells contains the text 'M,2' (no quotation marks) Unfortunately when the file is saved as a textfile, this is converted to '"M,2"' How can I save it exactly as I want it? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gordon Rainsford presented the following explanation :
I've written some VBA that populates data in a spreadsheet, then combines the data so that there's only data in the first column and each row in the first column is one string of data. I need to save it as a textfile, but I'm having two problems with this. I can't seem to save it without a .txt extension being added to the filename.. Secondly, one of the cells contains the text 'M,2' (no quotation marks) Unfortunately when the file is saved as a textfile, this is converted to '"M,2"' How can I save it exactly as I want it? If you use VBA to dump the data into a text file via VBA's standard file I/O functions, you can save it with any filename.ext you like. Also, the data will be exactly however you combine it. This would be easy to do by loading it into an array or delimited strings followed by a vbCrLf for each row of data. Look up file I/O and the use of the Join() and Split() functions. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for this good advice - it got me on the right track.
Gordon Rainsford On Dec 6, 10:36*pm, GS wrote: Gordon Rainsford presented the following explanation : I've written some VBA that populates data in a spreadsheet, then combines the data so that there's only data in the first column and each row in the first column is one string of data. I need to save it as a textfile, but I'm having two problems with this. I can't seem to save it without a .txt extension being added to the filename.. Secondly, one of the cells contains the text 'M,2' (no quotation marks) Unfortunately when the file is saved as a textfile, this is converted to '"M,2"' How can I save it exactly as I want it? If you use VBA to dump the data into a text file via VBA's standard file I/O functions, you can save it with any filename.ext you like. Also, the data will be exactly however you combine it. This would be easy to do by loading it into an array or delimited strings followed by a vbCrLf for each row of data. Look up file I/O and the use of the Join() and Split() functions. -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gordon Rainsford was thinking very hard :
Thanks for this good advice - it got me on the right track. Gordon Rainsford On Dec 6, 10:36*pm, GS wrote: Gordon Rainsford presented the following explanation : I've written some VBA that populates data in a spreadsheet, then combines the data so that there's only data in the first column and each row in the first column is one string of data. I need to save it as a textfile, but I'm having two problems with this. I can't seem to save it without a .txt extension being added to the filename.. Secondly, one of the cells contains the text 'M,2' (no quotation marks) Unfortunately when the file is saved as a textfile, this is converted to '"M,2"' How can I save it exactly as I want it? If you use VBA to dump the data into a text file via VBA's standard file I/O functions, you can save it with any filename.ext you like. Also, the data will be exactly however you combine it. This would be easy to do by loading it into an array or delimited strings followed by a vbCrLf for each row of data. Look up file I/O and the use of the Join() and Split() functions. -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text - - Show quoted text - Always glad to be of help!<g -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
open text file, get file from directory, update file | Excel Programming | |||
Saving multi-tab excel file created from comma delimited text file | Excel Programming | |||
How do I import text file, analyze data, export results, open next file | Excel Programming | |||
Excel VBA - open text file, replace text, save file? | Excel Programming | |||
importing text file, removing data and outputting new text file | Excel Programming |