Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default write a line from Excel to a text file

Having tested for the correct 'key word' , when found i want to write
out the whole row to a new file.

While Worksheets(1).Cells(irowcount, 1) < ""
If InStr(1, Worksheets(1).Cells(irowcount, 1), "STATION",
vbTextCompare) 0 Then
ts.writeline Worksheets(1).irowcount
End If

This line doesn't work

ts.writeline Worksheets(1).irowcount
nor does
ts.writeline Worksheets(1).cells(irowcount,1:40)

can any one help

Julian brotheton.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default write a line from Excel to a text file

writeline needs a string
how about
ts.writeline Worksheets(1).cells(irowcount,1).value
if you are trying to write the values from columns 1 to 40 use a for loop
for i = 1 to 40
ts.writeline Worksheets(1).cells(irowcount,i).value
next i
of course this creates 40 lines of text. You may want to look at the write
# if you are looking for delimited data

Paul D


"julian_bro" wrote in message
...
Having tested for the correct 'key word' , when found i want to write
out the whole row to a new file.

While Worksheets(1).Cells(irowcount, 1) < ""
If InStr(1, Worksheets(1).Cells(irowcount, 1), "STATION",
vbTextCompare) 0 Then
ts.writeline Worksheets(1).irowcount
End If

This line doesn't work

ts.writeline Worksheets(1).irowcount
nor does
ts.writeline Worksheets(1).cells(irowcount,1:40)

can any one help

Julian brotheton.



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
output to the same line in a Text file? Bernard Excel Discussion (Misc queries) 2 November 25th 09 08:12 PM
how can i open the write protected excel file? Vipul Shukla Excel Discussion (Misc queries) 1 November 7th 08 08:33 AM
Importing text file with no line delimiters mikewilsonuk Excel Discussion (Misc queries) 4 June 15th 06 06:47 AM
Why can't I write out an Excel file? greaseman Excel Discussion (Misc queries) 3 April 24th 06 06:21 PM
Access an excel file through FTP without write protection jj Excel Discussion (Misc queries) 0 October 10th 05 09:47 PM


All times are GMT +1. The time now is 08:27 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"