ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IN EXCEL, HOW DO I KEEP TWO LINES OF DATA TOGETHER WHEN SORTING (N (https://www.excelbanter.com/excel-discussion-misc-queries/253025-excel-how-do-i-keep-two-lines-data-together-when-sorting-n.html)

Cheryl

IN EXCEL, HOW DO I KEEP TWO LINES OF DATA TOGETHER WHEN SORTING (N
 
In a data base, I have customer information and blank lines in between to
separate the data. I want to keep the blank lines under the customer
information to make the data base easier to read, how do I do this?

Ron100

IN EXCEL, HOW DO I KEEP TWO LINES OF DATA TOGETHER WHEN SORTING (N
 
One easy way - if there are not too many entries - is to repeat the entry in
the sort column on the blank line in white text.
Ron

"Cheryl" wrote:

In a data base, I have customer information and blank lines in between to
separate the data. I want to keep the blank lines under the customer
information to make the data base easier to read, how do I do this?


Otto Moehrbach[_2_]

IN EXCEL, HOW DO I KEEP TWO LINES OF DATA TOGETHER WHEN SORTING (N
 
Cheryl
This little macro will do that. As written, this macro sorts all data
from A2 down to the last entry in Column A, 7 columns wide. This will
remove all blank rows. This macro will then insert blank rows like you
want. Another way to get what you want, i.e. easier to read, is to have no
blank rows but color alternate rows. HTH Otto
Sub SortAll()
Dim rColA As Range
Dim c As Long
Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
rColA.Resize(, 7).Sort Key1:=Range("A2"), Order1:=xlAscending,
Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
For c = rColA.Count To 1 Step -1
rColA(c).Offset(1).EntireRow.Insert
Next c
End Sub

"Cheryl" wrote in message
...
In a data base, I have customer information and blank lines in between to
separate the data. I want to keep the blank lines under the customer
information to make the data base easier to read, how do I do this?



Gord Dibben

IN EXCEL, HOW DO I KEEP TWO LINES OF DATA TOGETHER WHEN SORTING (N
 
Get rid of the blank lines and simply set the rows to double height.


Gord Dibben MS Excel MVP

On Mon, 11 Jan 2010 14:05:01 -0800, Cheryl
wrote:

In a data base, I have customer information and blank lines in between to
separate the data. I want to keep the blank lines under the customer
information to make the data base easier to read, how do I do this?




All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com