View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
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