Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Duplicate Rows Macro Question | Excel Discussion (Misc queries) | |||
Quick Macro question - How to delete two rows then skip one - and repeat | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions | |||
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 | Excel Programming | |||
Annoying delete empty rows question | Excel Programming |