Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Partial Grid Lines | Excel Discussion (Misc queries) | |||
Code for Inserting Multiple lines | Excel Discussion (Misc queries) | |||
Missing lines in chart w/x-axis with months 1-24... | Charts and Charting in Excel | |||
Separate first and second name in one cell into separate cells. | Excel Discussion (Misc queries) | |||
Add more lines and more columns in Excel | Excel Worksheet Functions |