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

I would like to export some data (with tab delimiter) from excel, with
HEADER which is string, to .txt file. In exported .txt file, I get quotation
(" ") for string which I don't want. I have written:

Open "test.txt" for output as #1
print #1, "Time", tab, "Average"

for i = 1 to lastrow
Print #1, sheets("test").Cells(i,1), tab, sheets("test").Cells(i,3)
next i

I want the text file as:
Time (Tab) Average
1/1/1999 (Tab) 3.5
1/2/1999 (Tab) 5.5

Could you please help me out?

Thanks,
Nazrul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default text file with tab

Try
Open "H:\test.txt" For Output As #1
Print #1, "Time", vbTab, "Average"
For i = 1 To lastrow
Print #1, Sheets("sheet1").Cells(i, 1), vbTab,
Sheets("sheet1").Cells(i, 3)
Next i
Close #1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Nazrul" wrote in message
...
I would like to export some data (with tab delimiter) from
excel, with
HEADER which is string, to .txt file. In exported .txt file, I
get quotation
(" ") for string which I don't want. I have written:

Open "test.txt" for output as #1
print #1, "Time", tab, "Average"

for i = 1 to lastrow
Print #1, sheets("test").Cells(i,1), tab,
sheets("test").Cells(i,3)
next i

I want the text file as:
Time (Tab) Average
1/1/1999 (Tab) 3.5
1/2/1999 (Tab) 5.5

Could you please help me out?

Thanks,
Nazrul




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
Can I import text file of cash flow to excel file then use formula Bumpa Excel Discussion (Misc queries) 2 May 28th 10 04:22 PM
How to tell number of spaces between values in saved text file fromthe original xls file [email protected] Excel Discussion (Misc queries) 1 January 15th 08 11:52 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
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 02:41 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"