Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I was wondering if anyone could help me with this. I have a shee with columns A:I containing data. In column D, there are numbers, th majority of which repeat. I wanted to "group" those together b inserting blank rows after each group, for example, if there is a grou of 12 consecutive rows in which the number 58496351 is in column D, want a blank row inserted after the last row which contains tha number; another group of 2 rows in which 9633698714 is in column D blank row, and so forth. So far the closest I've come is with thi macro: Sub Insert_Blank_Rows() Columns("D:D").AdvancedFilter Action:=xlFilterInPlace, Unique:=True Selection.End(xlDown).Select If Selection.Rows.Hidden = False Then ActiveCell.EntireRow.Insert shift:=xlUp ActiveCell.Offset(-1, 0).Select End If End Sub It does an advanced filter on column d, then, presumably, if the row i not hidden then it inserts a blank row after it. I don't know i there's a more efficient way to do it, I'd like to know if there is. But the thing with that macro is that I'm not sure how to implement loop in it. I tried a Do While...Loop Until and it gives me an "Objec required" error. So how do I get this thing to loop, or is there better way to do this? :confused -- carg ----------------------------------------------------------------------- carg1's Profile: http://www.excelforum.com/member.php...fo&userid=1527 View this thread: http://www.excelforum.com/showthread.php?threadid=26895 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy to filtered blank rows from another spreadsheet | Excel Discussion (Misc queries) | |||
How do I count rows in a filtered list when using AutoFilter? | Excel Worksheet Functions | |||
Define a range containing the first 10 rows of a filtered list | Excel Worksheet Functions | |||
colour alternate rows in filtered list | Excel Programming | |||
Filtered Visible Rows & VBA Non-Filtered Rows Displayed | Excel Programming |