PC Review


Reply
Thread Tools Rate Thread

Adding blank rows between groups of similar names

 
 
=?Utf-8?B?SnVzdGlu?=
Guest
Posts: n/a
 
      6th Jul 2007
I have a spreadsheet that is about 1200 rows long. The first column contains
names of funds, and the other columns contain different information about
them. To extremely simplify what I'm trying to do, take the following list
for example.
A
A
B
B
B
C
D
D
This is what my first column looks like. I'd like to have Excel search
through and put blank rows between the dissimilar groups so that it looks
like the following
A
A

B
B
B

C

D
D
Any Ideas? This is going to take me a long time to do manually... and then
I want to make those blank rows color too, but doing that manually isn't
quite as bad. Thanks All
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      6th Jul 2007
Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long
Dim iLastRow As Long

Application.ScreenUpdating = False

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 2 Step -1
If .Cells(i, TEST_COLUMN).Value <> .Cells(i - 1,
TEST_COLUMN).Value Then
.Rows(i).Insert
.Rows(i).Interior.ColorIndex = 38
End If
Next i

End With

Application.ScreenUpdating = True

End Sub




--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Justin" <(E-Mail Removed)> wrote in message
news:E15ED28A-4D6C-44CC-B696-(E-Mail Removed)...
>I have a spreadsheet that is about 1200 rows long. The first column
>contains
> names of funds, and the other columns contain different information about
> them. To extremely simplify what I'm trying to do, take the following
> list
> for example.
> A
> A
> B
> B
> B
> C
> D
> D
> This is what my first column looks like. I'd like to have Excel search
> through and put blank rows between the dissimilar groups so that it looks
> like the following
> A
> A
>
> B
> B
> B
>
> C
>
> D
> D
> Any Ideas? This is going to take me a long time to do manually... and
> then
> I want to make those blank rows color too, but doing that manually isn't
> quite as bad. Thanks All



 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      6th Jul 2007
If you copy your column of names (with a heading) into another sheet,
you could then apply advanced filter to the column and obtain a unique
list of names. In your original sheet you can insert a new column A
and just copy the names from column B into the new column A. Then you
can apply the coloured background to the unique names (and a few other
columns) in the second sheet and copy them back to the original sheet
at the bottom of your data in column A. Then highlight all the data in
the orginal sheet (including the new column A) and do Data | Sort
using column A then column B as the sort fields. You can then delete
column A, and you can delete the worksheet with the unique names and
now you should have what you want.

Hope this helps.

Pete

On Jul 6, 7:10 pm, Justin <Jus...@discussions.microsoft.com> wrote:
> I have a spreadsheet that is about 1200 rows long. The first column contains
> names of funds, and the other columns contain different information about
> them. To extremely simplify what I'm trying to do, take the following list
> for example.
> A
> A
> B
> B
> B
> C
> D
> D
> This is what my first column looks like. I'd like to have Excel search
> through and put blank rows between the dissimilar groups so that it looks
> like the following
> A
> A
>
> B
> B
> B
>
> C
>
> D
> D
> Any Ideas? This is going to take me a long time to do manually... and then
> I want to make those blank rows color too, but doing that manually isn't
> quite as bad. Thanks All



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
INDEX similar names in different rows mariekek5 Microsoft Excel Misc 4 25th Jun 2009 10:28 AM
Adding rows in Excel Similar to Access =?Utf-8?B?b3V0c29s?= Microsoft Excel Misc 2 17th Aug 2007 02:20 AM
Adding a Blank between Names! Bob Microsoft Access 1 10th Aug 2006 06:27 AM
Output array to Excel blank rows separating groups ghh3rd Microsoft Excel Programming 0 1st Mar 2006 07:52 PM
Insert blank rows between groups? Muppet Microsoft Access Queries 1 12th Apr 2004 07:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:24 AM.