B
bawpie
Hi, I am looking to create a macro that can find data in a column then find
another specific entry in the same column and delete the data between the two
points. I have tried looking for other examples within the newsgroup but
most are to delete one specific row or to delete to the end of data etc and
therefore are not quite suitable.
Anyway, I have a worksheet. In Column A I might have:
A
Number 203
Service
Start Date
Closure
Reason for Closure
End
Number 205
Service
Start Date
Closure
Reason for Closure
End
Number 222
Service
Start Date
Closure
Reason for Closure
End
What I would like the macro to do is to locate 'Number 205' and delete each
row including Number 205 down to the first 'end' after 'Number 205.' The
rows between the 'Number' entry and the 'end' entry may sometimes vary so it
can't just locate the number and delete down a certain amount of rows.
Additionally, I would like the macro to work from a list located in another
sheet within the workbook, for example if I had a list like this in a sheet
called 'To Delete'
it would look like this:
A
Number 205
Number 222
So the macro needs to reference the list in the seperate sheet so it looks
for 205-end and deletes, then looks for 222-end and deletes and so on.
Hopefully there is a way of doing this, all advice and help is gratefully
received.
Thanks
another specific entry in the same column and delete the data between the two
points. I have tried looking for other examples within the newsgroup but
most are to delete one specific row or to delete to the end of data etc and
therefore are not quite suitable.
Anyway, I have a worksheet. In Column A I might have:
A
Number 203
Service
Start Date
Closure
Reason for Closure
End
Number 205
Service
Start Date
Closure
Reason for Closure
End
Number 222
Service
Start Date
Closure
Reason for Closure
End
What I would like the macro to do is to locate 'Number 205' and delete each
row including Number 205 down to the first 'end' after 'Number 205.' The
rows between the 'Number' entry and the 'end' entry may sometimes vary so it
can't just locate the number and delete down a certain amount of rows.
Additionally, I would like the macro to work from a list located in another
sheet within the workbook, for example if I had a list like this in a sheet
called 'To Delete'
it would look like this:
A
Number 205
Number 222
So the macro needs to reference the list in the seperate sheet so it looks
for 205-end and deletes, then looks for 222-end and deletes and so on.
Hopefully there is a way of doing this, all advice and help is gratefully
received.
Thanks