View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
alrastro alrastro is offline
external usenet poster
 
Posts: 4
Default Carriage return character

Hi:
thank you for your response.

Maybe i wasn't clear on my problem but the end of carriage is in the last
line of the import text file, the chr(13) is the last line of the text file,
when it goes to excel it disappear, I couldn't find it, and I need to find
that last line of the import file in excel.
I need to know where this import file ends.
Thanks

"Pflugs" wrote:

I'm having a little trouble understanding the problem, but I can tell you
that the characters Chr(10) and Chr(13) are probably at the source. You can
check for those characters or replace them before copying the text to the
sheet.

Try this code written by Tom Ogilvy:

Sub ReplaceLittleSquares()
Cells.Replace What:=Chr(10), _
Replacement:="", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
Cells.Replace What:=Chr(13), _
Replacement:="", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub

Good luck,
Pflugs

"alrastro" wrote:

Hi,
I'm importing a text file into excel no problem there, here is my question.
I need to know the last line of the text file, this files ends in a empty
blank line that only have a carriage return or enter character or blank line.
When i'm trying to read this row in cell is a blank line, no difference
bettewn that an a blank excel cell; that doesn't help, I would like to know
if there's a way to read that carriage return or enter or blank line of this
text file on

Thank you so much.