PC Review


Reply
Thread Tools Rate Thread

delete random rows

 
 
donwb
Guest
Posts: n/a
 
      15th Oct 2009
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


 
Reply With Quote
 
 
 
 
Rick Rothstein
Guest
Posts: n/a
 
      15th Oct 2009
The code line you posted works fine for me.

--
Rick (MVP - Excel)


"donwb" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>


 
Reply With Quote
 
donwb
Guest
Posts: n/a
 
      16th Oct 2009
Thanks guys
I thought it should work.
Now it does.
Don't know what I was doing wrong.
Thanks
donwb



"p45cal" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
>
> donwb;526867 Wrote:
>> 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

>
> It works here, only deleting the rows of those cells, contiguous or
> not.
> Selecting non-contiguous cells and executing
> selection.entirerow.delete
> also worked as expected.
> (xl2003 and xl 2007)
>
>
> --
> p45cal
>
> *p45cal*
> ------------------------------------------------------------------------
> p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
> View this thread:
> http://www.thecodecage.com/forumz/sh...d.php?t=144696
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofil on variable rows, delete extract and show remaining rows 1plane Microsoft Excel Programming 3 17th Nov 2009 10:49 AM
Copy pasting Rows, but need to Delete any Shapes/Pictures that are within copied rows Corey Microsoft Excel Programming 2 1st Aug 2007 02:02 AM
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows Scott Microsoft Excel Worksheet Functions 0 13th Dec 2006 01:25 AM
random rows Scott Reynolds Microsoft Access 1 3rd Sep 2004 12:02 PM
Random rows.... Goran Stjepanovic Microsoft Excel Programming 1 18th Mar 2004 07:45 AM


Features
 

Advertising
 

Newsgroups
 


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