View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default SKIP EMPTY ROWS FROM IMPORT

"R.V. DEURSEN" wrote...
I have a tab delimited .txt file for import in Excel.
After import it has empty rows between every row.
Is it possible automaticely import the text rows and skip
the empty ones during import in excel
(in VBA)


I doubt it. This could happen if the application generating these .TXT files
were screwing up the newline characters. Specifically, under Windows this is
what Excel does if the ASCII carridge return (ASCII decimal character code
13) comes before the ASCII linefeed (ASCII decimal character code 10).

Where are these .TXT files coming from?

Anyway, there's a relatively simple way to fix this. If the data from the
..TXT file filled A1:Z200 with every other row empty, select AA1:AA200 with
AA1 the active cell, type the formula

=IF(COUNTA(A1:Z1),ROW(),1E10)

hold down a [Ctrl] key and press the [Enter] key. Select A1:AA200. Sort on
column AA in ascending order. Then clear column AA.