Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import/Export Text File Tab Delimiter
Hi there,
I would like to import/export data to text files using tab delimiter. This helps user to save/load configurations or share them with others. I know how to import a text file to a range. How can I export a range of cells into a text file so that it can be loaded later. Regards, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import/Export Text File Tab Delimiter
method (1)
copy the range to a new workbook, then saevas using the CSV as a delimer Option Explicit Sub SaveToCSV() Dim Source As Range Dim wb As Workbook Set Source = Range("MyData") Set wb = Workbooks.Add() wb.ActiveSheet.Range(Source.Address).Value = Source.Value wb.SaveAs "c:\temp\MyCSV.csv", xlCSV wb.Close False End Sub Method(2) OPEN a stream to a text file & write the data line by line. Build the line using a FOR...NEXT loop concotenating the cell values with a ";" .... much to tedious! HTH Patrick Molloy Microsoft Excel MVP "Cool Sport" wrote: Hi there, I would like to import/export data to text files using tab delimiter. This helps user to save/load configurations or share them with others. I know how to import a text file to a range. How can I export a range of cells into a text file so that it can be loaded later. Regards, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import/Export Text File Tab Delimiter
Thanks a lot :)
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import/Export Text File Tab Delimiter
Here is an additional thought:
If you want Tab delimited, go to File=Save As and select Tab delimited as the file type. If you want code, turn on the macro recorder while you do it manually. (record to a different workbook than the one being saved as a tab delimited file). -- Regards, Tom Ogilvy "Cool Sport" wrote in message ... Thanks a lot :) *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Import and Export Text data | Excel Discussion (Misc queries) | |||
Need Help Importing Text File Using Two or More Spaces as the Delimiter | Excel Discussion (Misc queries) | |||
Changing Export Delimiter | Excel Discussion (Misc queries) | |||
export excel file as csv with text delimiter of " | Excel Discussion (Misc queries) | |||
Export excel file to semicolon delimited text file | Excel Discussion (Misc queries) |