Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Open tab text file method

i use "open file for input" method to import text from text file to excel.

however it import the text as a whole line, without any tab separation.

is there any method i can reserve the "TAB" from text file to Excel.

Thanks.

tony


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Open tab text file method

i use "open file for input" method to import text from text file to
excel.
however it import the text as a whole line, without any tab
separation.
is there any method i can reserve the "TAB" from text file to Excel.


One solution would be to open a blank workbook, turn on the macro
recorder (have the macro recorded in the current blank workbook) and go
through manually what you do when you import the text file, remmebering to
set Tab as the delimiter. Then look at the code generated and edit the macro
if need be, if it needs generalising.

The code that opens the text file will look something like this:

Workbooks.OpenText Filename:="<Your txt filename", dataType:=xlDelimited,
tab:=True ...


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 CSV file, format data and write output to a text file. BristolBloos Excel Programming 1 October 18th 05 03:50 PM
method 'open text' of object 'workbooks' failed tina Excel Programming 6 September 20th 05 11:18 AM
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
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM


All times are GMT +1. The time now is 03:30 AM.

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"