Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
hsg hsg is offline
external usenet poster
 
Posts: 40
Default help on deleting several rows at once

I wish to delete multiple, non continuous rows at once. When such rows are
selected, it says "This operation can not be performed on multiple objects".
The rows in question run into hundreds, say I would like to delete all even
rows, or every third row from ROW 1 onwards

can you please help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default help on deleting several rows at once

Hi
do you have merged cells in your selected range. Also you may post the code
you have tried

"hsg" wrote:

I wish to delete multiple, non continuous rows at once. When such rows are
selected, it says "This operation can not be performed on multiple objects".
The rows in question run into hundreds, say I would like to delete all even
rows, or every third row from ROW 1 onwards

can you please help

  #3   Report Post  
Posted to microsoft.public.excel.programming
hsg hsg is offline
external usenet poster
 
Posts: 40
Default help on deleting several rows at once

Actually I want to delete, in present case, all even numbered rows, and there
are no merged cells, and I have not tried any code so far.

I selected alternate rows, and deleted by right clicking and "delete",

but since the rows number into hundreds or so, I wanted to know how can this
be done using a macro, or otherwise also.

harsh

"Frank Kabel" wrote:

Hi
do you have merged cells in your selected range. Also you may post the code
you have tried

"hsg" wrote:

I wish to delete multiple, non continuous rows at once. When such rows are
selected, it says "This operation can not be performed on multiple objects".
The rows in question run into hundreds, say I would like to delete all even
rows, or every third row from ROW 1 onwards

can you please help

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default help on deleting several rows at once


Below code will delete Odd rows, in the used range:-

Sub delRowOdd()
Dim i As Long, rDelRow As Range, totRows As Long

With Worksheets("Sheet1")
totRows = .UsedRange.Cells.Rows.Count
Set rDelRow = .Rows(1)
For i = 1 To totRows Step 2
Set rDelRow = Union(rDelRow, .Rows(i))
Next i
End With
rDelRow.EntireRow.Delete

End Sub

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default help on deleting several rows at once

Manually:

Insert a new column (column A).

Put X in A1
Put Y in A2

Select A1:A2 and rightclick and drag down.
let go and choose copy.

Apply Data|filter|autofilter and show only the rows you want to delete.
select those visible rows and rightclick|delete|entirerow

Remove the autofilter and delete your helper column.



hsg wrote:

I wish to delete multiple, non continuous rows at once. When such rows are
selected, it says "This operation can not be performed on multiple objects".
The rows in question run into hundreds, say I would like to delete all even
rows, or every third row from ROW 1 onwards

can you please help


--

Dave Peterson
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
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Links and Linking in Excel 1 November 13th 08 08:44 AM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Setting up and Configuration of Excel 1 November 12th 08 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Worksheet Functions 1 November 12th 08 01:39 PM
Help!! I have problem deleting 2500 rows of filtered rows!!!! shirley_kee Excel Discussion (Misc queries) 1 January 12th 06 03:24 AM
deleting hidden rows so i can print only the rows showing?????? jenn Excel Worksheet Functions 0 October 6th 05 04:05 PM


All times are GMT +1. The time now is 06:11 AM.

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"