ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Deleting rows before importing (https://www.excelbanter.com/excel-programming/350386-deleting-rows-before-importing.html)

Mark[_61_]

Deleting rows before importing
 
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


JakeyC

Deleting rows before importing
 
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.



All times are GMT +1. The time now is 03:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com