Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default delete random rows

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default delete random rows

The code line you posted works fine for me.

--
Rick (MVP - Excel)


"donwb" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default delete random rows


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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default delete random rows

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



"p45cal" wrote in message
...

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
select cell at random and delete contents JJ[_8_] Excel Programming 2 September 1st 05 11:45 PM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM
In a column of text data, how do I delete random cells that have . Minivann Excel Discussion (Misc queries) 2 January 26th 05 09:07 PM
Delete every 3rd row, then delete rows 2-7, move info f/every 2nd row up one to the end and delete the row below Annette[_4_] Excel Programming 2 September 21st 04 02:40 PM
Sort and delete for a random sample? JayL. Excel Programming 3 September 30th 03 03:56 PM


All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"