Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Import and Export Text data yanks6rule Excel Discussion (Misc queries) 2 February 27th 09 05:01 PM
Need Help Importing Text File Using Two or More Spaces as the Delimiter [email protected] Excel Discussion (Misc queries) 11 June 13th 06 02:08 AM
Changing Export Delimiter Total Hosting 1 Excel Discussion (Misc queries) 6 May 30th 05 05:23 AM
export excel file as csv with text delimiter of " John Excel Discussion (Misc queries) 2 May 12th 05 05:50 PM
Export excel file to semicolon delimited text file capitan Excel Discussion (Misc queries) 5 April 7th 05 03:06 AM


All times are GMT +1. The time now is 06:40 PM.

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

About Us

"It's about Microsoft Excel"