Deleting rows before importing

M

Mark

I import text files daily into EXCEL using a wizard. However what I
would like to do is import them without a wizard. The problem I have is
that using the wizard I can set text file to start importing at the
10th row or 50th row or even the 3rd row. Every day the file will be
different dependin on the amount of data on the text file. In between
the data sets on this text file are 4 or 5 rows I want deleted.
Basically there are 7 data sets, with useless data rows at the top and
in between each data set. Can this import be done programatically? If
can some one show me how.

Mark
 
J

JakeyC

You're best off importing and then deleting.

Start by defining what you need to consider when deciding where to
start the data (what affects which row it gets imported into?).

Secondly, think about how to describe the rows that need to be deleted.
Is it always rows 18-22 say, or is it relative to the data the appears
above it? In which case, you'll need an expression to calculate what to
delete and where.

Once you have this worked out, try recording a macro when you import
and replace any 'hard-coded' values with the expressions that you
worked out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top