Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
ConfusedNHouston
 
Posts: n/a
Default Separate Groups by Inserting Lines

In looking at column A in a spreadsheet, I have successive groups of like
entries. For instance cells A2 through A6 might all pertain to a given
product, with the data in columns B through E defining that product. Cell A7
through A11 might pertain to another product; A12 through A15 to another, etc.

I'd like to separate the products by inserting one or two (possibly more)
blank lines. How would I do this? Is there a way to use the "IF" statement,
IF(A7 is not equal to A6, then insert lines in rows 7 and 8). Or is there a
way to write a macro that will validate one cell's content relative to
another? A macro that would spot an inequality in cell contents (text) and
use the occurance of inequality as the insertion point for a blank row?
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default Separate Groups by Inserting Lines

Maybe using excel's built in Data|Subtotals would be sufficient.

In fact, you'd be able to get subtotals for each of your columns.

ConfusedNHouston wrote:

In looking at column A in a spreadsheet, I have successive groups of like
entries. For instance cells A2 through A6 might all pertain to a given
product, with the data in columns B through E defining that product. Cell A7
through A11 might pertain to another product; A12 through A15 to another, etc.

I'd like to separate the products by inserting one or two (possibly more)
blank lines. How would I do this? Is there a way to use the "IF" statement,
IF(A7 is not equal to A6, then insert lines in rows 7 and 8). Or is there a
way to write a macro that will validate one cell's content relative to
another? A macro that would spot an inequality in cell contents (text) and
use the occurance of inequality as the insertion point for a blank row?


--

Dave Peterson
  #3   Report Post  
Debra Dalgleish
 
Posts: n/a
Default Separate Groups by Inserting Lines

Another way to separate the groups is to use conditional formatting:

Select the cells you want to format, e.g. A2:E500
Choose FormatConditional Formatting
From the first dropdown, choose Formula Is
In the formula box, enter a formula that refers to the active row
(row 2 in this example): =$A2<$A1
Click the Format button
From the Pattern tab, select a colour for the first row in each group
Click OK, click OK

ConfusedNHouston wrote:
In looking at column A in a spreadsheet, I have successive groups of like
entries. For instance cells A2 through A6 might all pertain to a given
product, with the data in columns B through E defining that product. Cell A7
through A11 might pertain to another product; A12 through A15 to another, etc.

I'd like to separate the products by inserting one or two (possibly more)
blank lines. How would I do this? Is there a way to use the "IF" statement,
IF(A7 is not equal to A6, then insert lines in rows 7 and 8). Or is there a
way to write a macro that will validate one cell's content relative to
another? A macro that would spot an inequality in cell contents (text) and
use the occurance of inequality as the insertion point for a blank row?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

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
Partial Grid Lines Keith-in-Indy Excel Discussion (Misc queries) 4 August 17th 05 06:55 PM
Code for Inserting Multiple lines Frantic Excel-er Excel Discussion (Misc queries) 0 June 17th 05 06:36 PM
Missing lines in chart w/x-axis with months 1-24... DendWrite Charts and Charting in Excel 2 May 10th 05 09:04 PM
Separate first and second name in one cell into separate cells. Gary's Student Excel Discussion (Misc queries) 0 April 27th 05 11:11 PM
Add more lines and more columns in Excel Marc Charbonneau Excel Worksheet Functions 3 January 20th 05 03:44 AM


All times are GMT +1. The time now is 05:03 AM.

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"