PC Review


Reply
Thread Tools Rate Thread

Adding empty row with code

 
 
=?Utf-8?B?U0lUQ0ZhblRO?=
Guest
Posts: n/a
 
      7th Mar 2007
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 With Quote
 
 
 
 
=?Utf-8?B?Q2hhcmxlcyBDaGlja2VyaW5n?=
Guest
Posts: n/a
 
      7th Mar 2007
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 With Quote
 
=?Utf-8?B?Q2hhcmxlcyBDaGlja2VyaW5n?=
Guest
Posts: n/a
 
      8th Mar 2007
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Append multiple queries into an empty table via code -- code strive4peace Microsoft Access Queries 0 25th Jan 2007 10:46 AM
app won't run after adding an empty class =?Utf-8?B?RGF2ZSBDYWxraW5z?= Microsoft VC .NET 2 21st Nov 2006 07:50 AM
Re:adding empty row to combobox k magableh Microsoft Dot NET Framework Forms 0 31st Dec 2005 02:00 PM
adding formula in empty row =?Utf-8?B?QXN1?= Microsoft Excel Programming 4 4th Dec 2005 04:50 AM
adding redemption to my VB code leaves me with empty distribution list Dan Hicks Microsoft Outlook VBA Programming 3 5th Aug 2004 06:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:59 AM.