Separate Groups by Inserting Lines

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
Another way to separate the groups is to use conditional formatting:

Select the cells you want to format, e.g. A2:E500
Choose Format>Conditional 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top