Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
output to the same line in a Text file? | Excel Discussion (Misc queries) | |||
how can i open the write protected excel file? | Excel Discussion (Misc queries) | |||
Importing text file with no line delimiters | Excel Discussion (Misc queries) | |||
Why can't I write out an Excel file? | Excel Discussion (Misc queries) | |||
Access an excel file through FTP without write protection | Excel Discussion (Misc queries) |