LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete Rows question


I wish to get the following standard row-deletion code to be tweaked to
delete (not an enrireRow) but only rows across 3 columns - Columns A to
C.
I resorted to RESIZE method without success.

Sub DeleteRowsByCollection()

Dim c as Range
Dim rng as Range

For each c in Range("a1:a" & [a65536].End(xlUp).row)
If c.value = c.Offset(1,0).value Then
If rng Is Nothing Then
set rng = c.Resize(0,3) ========Application-defined or object-defined
error
Else
set rng = Union(rng, c.Resize(0,3))
End if
End if
Next

If not rng is Nothing then
rng.Delete
End if

End Sub

Deferring the RESIZING and applying it to the DELETE command as in
*rng.Resize(0,3).Delete * generates the same error.

TIA

Myles


--
Myles
------------------------------------------------------------------------
Myles's Profile: http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=522055

 
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
Delete Duplicate Rows Macro Question elfmajesty Excel Discussion (Misc queries) 1 June 17th 06 01:12 AM
Quick Macro question - How to delete two rows then skip one - and repeat David Smithz Excel Discussion (Misc queries) 3 March 3rd 06 02:58 PM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 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
Annoying delete empty rows question Tamsen Excel Programming 5 September 5th 03 03:39 AM


All times are GMT +1. The time now is 03:41 PM.

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

About Us

"It's about Microsoft Excel"