Guys,

I have problem which has been puzzling me today at work and I would like someones help please.

I have a sheet where you paste data in it, and by pressing a button sort_data it does a lot of sorting, filtering, deleting and so on. That works fine.

Then, I wanted to delete data according to a list and followed Richards instructions on:
http://www.excelforum.com/excel-prog...d-on-list.html

So I am creating two range names:

1. Data:
=OFFSET('Outstanding Confirmations'!$A$1,0,0,COUNTA('Outstanding Confirmations'!$A:$A),28)

2. Deletecriteria:
=OFFSET('deletecriteria'!$A$1,0,0,COUNTA('deletecriteria'!$A:$A),1)


However, following the sort_data method above, the first range becomes:

1. Data:
=OFFSET('Outstanding Confirmations'!#REF!,0,0,COUNTA('Outstanding Confirmations'!#REF!),28)

Making it impossible for the macro code to delete the rows.

Is there any way to fix it? For example I had though of defining the range name in the actual vba code just before the rows are deleted.

Thanks
DrChris