Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with text file

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Help with text file

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with text file

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Help with text file

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
open text file, get file from directory, update file Diana Excel Programming 2 February 3rd 10 05:28 AM
Saving multi-tab excel file created from comma delimited text file Marcus Aurelius Excel Programming 2 December 19th 05 05:16 PM
How do I import text file, analyze data, export results, open next file Geoffro Excel Programming 2 March 6th 05 08:02 PM
Excel VBA - open text file, replace text, save file? Cybert Excel Programming 2 October 2nd 04 01:05 AM
importing text file, removing data and outputting new text file Pal Excel Programming 8 February 27th 04 08:32 PM


All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"