Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 84
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default 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
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
adding rows, pasting values then empty sheet misscharliebrown Excel Worksheet Functions 2 October 30th 08 03:07 AM
Adding data from Form to empty rows in spreadsheet. dd Excel Programming 2 January 12th 07 04:56 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
adding formula in empty row Asu Excel Programming 4 December 4th 05 04:50 AM
adding row when user reaches the last available empty row Stacie Fugate Excel Programming 19 January 27th 05 07:44 PM


All times are GMT +1. The time now is 09:46 PM.

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"