Delete First & Last Line of Imported Data

vxs

Board Regular
Joined
Dec 10, 2008
Messages
61
Hi All,
I am importing some data from a .txt file but the import data's first and last lines are un-important headers and totals which get in the way of how I am using the data.

Other than having to manually delete them on each refresh what is the easiest way of automatically deleting them on import please?

Any help much appreciated. Spent some time googling and only found VB scripts which seems a bit extreme, thought their would be an option to unselect the top line or more...

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Is there a "trigger" I can use that remains the same in this first row and last row? For example will the first cell of the header be A1? or at least in column A? And same for last row. Does it always say Total or something and is it always in the same column?

If so, I can give you an easy copy paste VBA that will check for these triggers and if they exist, it will delete either the content of the rows or the entire rows as you'd like.
 
Upvote 0
Im afraid there isn't a trigger which is why I am struggling to find a useful solution when googling.

The First Line is TEXT which changes and the Last Line is a total in NUMBERS which changes. There is No Word TOTAL next to the last number in the last row.

I just thought there might be a script or option to Strip the first and last rows? Also the import data changes constantly so the amount of rows changes constantly, so I can't even say DELETE ROW 1 and DELETE ROW 100 because 100 might be 400.

Thank you for respodning and trying to help Roderick_E
 
Upvote 0

Forum statistics

Threads
1,216,045
Messages
6,128,477
Members
449,455
Latest member
jesski

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top