Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default place a blank row above certain cells

I would like to add a row above certain cells that repeat themself. For
example, Column T list several company names like this.
Arby's
Arby's
Arby's
Burger King
Burger King
Burger King

My list is very long and I would like to create a formula that would
automatically place a blank row between company names. Any help is greatly
appreciated. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default place a blank row above certain cells


something like

sub insertrowsif()
mc="a"
for i=cells(rows.count,mc).end(xlup).row to 2 step -1
if cells(i-1,mc)<cells(i,mc) then rows(i).insert
next i
end sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"aledger" wrote in message
...
I would like to add a row above certain cells that repeat themself. For
example, Column T list several company names like this.
Arby's
Arby's
Arby's
Burger King
Burger King
Burger King

My list is very long and I would like to create a formula that would
automatically place a blank row between company names. Any help is greatly
appreciated. Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default place a blank row above certain cells

Easy to do but will screw up any chance of sorting or filtering you may want to
do with the names.

Maybe better would be to make the first instance of each new name double-height?

Sub insertrowsif()
mc = "a"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i - 1, mc) < Cells(i, mc) Then
With Rows(i)
.RowHeight = .RowHeight * 2
End With
End If
Next i
End Sub


Gord Dibben MS Excel MVP

On Fri, 22 Feb 2008 07:51:02 -0800, aledger
wrote:

I would like to add a row above certain cells that repeat themself. For
example, Column T list several company names like this.
Arby's
Arby's
Arby's
Burger King
Burger King
Burger King

My list is very long and I would like to create a formula that would
automatically place a blank row between company names. Any help is greatly
appreciated. Thanks.


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
Index/match - make blank cells return a blank value. diaare Excel Worksheet Functions 3 May 3rd 23 03:44 AM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
How Do I Place a Picture Behind Cells Jon Excel Discussion (Misc queries) 2 January 29th 07 08:16 PM
Keeping cells in place Rj Excel Worksheet Functions 3 March 2nd 05 07:52 PM
why can't I place the cursor directly on certain cells? KG Excel Discussion (Misc queries) 3 January 31st 05 11:26 PM


All times are GMT +1. The time now is 06:59 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"