Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding empty row with code
I would like to add an empty row in my sheet based on the last entry in
column I that says "No Match". I'm sorting based on Col I so all the "No Matches" display first, then all the "Matches". Is there a way to use code to look at the text in Col I and add and empy row based on the last text entry of "No Match". I've searched previous posts with no luck. Thanks for your help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding empty row with code
Hi try this:
Dim r As Range Set r = Columns("I").Find(What:="No Match, _ After:=Range("I1"), LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, MatchCase:=True) If Not r Is Nothing Then r.Offset(1).EntireRow.Insert -- Charles Chickering "A good example is twice the value of good advice." "SITCFanTN" wrote: I would like to add an empty row in my sheet based on the last entry in column I that says "No Match". I'm sorting based on Col I so all the "No Matches" display first, then all the "Matches". Is there a way to use code to look at the text in Col I and add and empy row based on the last text entry of "No Match". I've searched previous posts with no luck. Thanks for your help. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding empty row with code
Oops. missed a closing quote.
Dim r As Range Set r = Columns("I").Find(What:="No Match", _ After:=Range("I1"), LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, MatchCase:=True) If Not r Is Nothing Then r.Offset(1).EntireRow.Insert -- Charles Chickering "A good example is twice the value of good advice." "Charles Chickering" wrote: Hi try this: Dim r As Range Set r = Columns("I").Find(What:="No Match, _ After:=Range("I1"), LookIn:=xlFormulas, _ LookAt:=xlWhole, SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, MatchCase:=True) If Not r Is Nothing Then r.Offset(1).EntireRow.Insert -- Charles Chickering "A good example is twice the value of good advice." "SITCFanTN" wrote: I would like to add an empty row in my sheet based on the last entry in column I that says "No Match". I'm sorting based on Col I so all the "No Matches" display first, then all the "Matches". Is there a way to use code to look at the text in Col I and add and empy row based on the last text entry of "No Match". I've searched previous posts with no luck. Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
adding rows, pasting values then empty sheet | Excel Worksheet Functions | |||
Adding data from Form to empty rows in spreadsheet. | Excel Programming | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
adding formula in empty row | Excel Programming | |||
adding row when user reaches the last available empty row | Excel Programming |