Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Blank rows in a filtered list


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Blank rows in a filtered list

Have you tried the built in Data|subtotals.

The new rows may not be blank, but you could clear them if you want.

Using the outline symbols at the right, just show the subtotal lines that you
want to clear.

Select your range
edit|goto|special|blanks
and hit the delete key on the keyboard.

You can turn off the outlining symbols via:
tools|options|view tab

(but I like those subtotals--even if it's just a count of the key column.)

Remember to have your data sorted the way you want before you do data|subtotals.

carg1 wrote:

Hi, I was wondering if anyone could help me with this. I have a sheet
with columns A:I containing data. In column D, there are numbers, the
majority of which repeat. I wanted to "group" those together by
inserting blank rows after each group, for example, if there is a group
of 12 consecutive rows in which the number 58496351 is in column D, I
want a blank row inserted after the last row which contains that
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 this
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 is
not hidden then it inserts a blank row after it. I don't know if
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 a
loop in it. I tried a Do While...Loop Until and it gives me an "Object
required" error. So how do I get this thing to loop, or is there a
better way to do this?

--
carg1
------------------------------------------------------------------------
carg1's Profile: http://www.excelforum.com/member.php...o&userid=15271
View this thread: http://www.excelforum.com/showthread...hreadid=268955


--

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
Copy to filtered blank rows from another spreadsheet Juan Excel Discussion (Misc queries) 0 April 28th 10 07:59 PM
How do I count rows in a filtered list when using AutoFilter? chiefcook Excel Worksheet Functions 6 November 10th 08 09:21 AM
Define a range containing the first 10 rows of a filtered list Marco Excel Worksheet Functions 3 October 7th 05 01:42 PM
colour alternate rows in filtered list RW[_3_] Excel Programming 9 September 8th 04 10:27 AM
Filtered Visible Rows & VBA Non-Filtered Rows Displayed QTE[_15_] Excel Programming 8 July 11th 04 02:21 AM


All times are GMT +1. The time now is 02:03 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"