delete random rows

D

donwb

Excel 2003
I need some code which will delete rows containing cells I have selected.
Some cells may be adjacent then a space then more as below.
I have tried the following, but it doesn't appear work with non-adjacent
selections.
Range("D4,D5,D11,D12,D13,D14,D17,D19, D23,D24").EntireRow.Delete
How can this be done?
donwb
 
P

p45cal

donwb;526867 said:
Excel 2003
I need some code which will delete rows containing cells I hav
selected.
Some cells may be adjacent then a space then more as below.
I have tried the following, but it doesn't appear work wit
non-adjacent
selections.
Range("D4,D5,D11,D12,D13,D14,D17,D19, D23,D24").EntireRow.Delete
How can this be done?
donwb

It works here, only deleting the rows of those cells, contiguous o
not.
Selecting non-contiguous cells and executing
selection.entirerow.delete
also worked as expected.
(xl2003 and xl 2007
 
D

donwb

Thanks guys
I thought it should work.
Now it does.
Don't know what I was doing wrong.
Thanks
donwb
 

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