PC Review


Reply
Thread Tools Rate Thread

delete rows with header, excluding 1st row

 
 
J.W. Aldridge
Guest
Posts: n/a
 
      30th Mar 2010
Headers are repeated several times between rows A1:A1000.
Need to delete all rows where header "DAY" is in column A, except for
the first instance (A1).

 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      30th Mar 2010
try code like the following:

Sub AAA()
Dim N As Long
With ActiveSheet
N = .Cells(.Rows.Count, "A").End(xlUp).Row
Do Until N = 1
If StrComp(.Cells(N, "A"), "DAY", vbTextCompare) = 0 Then
.Rows(N).Delete
End If
N = N - 1
Loop
End With
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com



On Tue, 30 Mar 2010 10:25:28 -0700 (PDT), "J.W. Aldridge"
<(E-Mail Removed)> wrote:

>Headers are repeated several times between rows A1:A1000.
>Need to delete all rows where header "DAY" is in column A, except for
>the first instance (A1).

 
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
Code to delete rows excluding Header if not = to PVANS Microsoft Access VBA Modules 3 22nd Mar 2010 11:00 AM
Excluding Rows During Printout kjell.uddeborg@gmail.com Microsoft Excel Discussion 4 17th Mar 2009 06:24 AM
Countif excluding hidden rows qh8519a Microsoft Excel Worksheet Functions 4 19th Sep 2008 06:22 PM
How do i split my column excluding the header into three sections =?Utf-8?B?TGluemk=?= Microsoft Excel Misc 2 31st Aug 2006 12:18 AM
excluding some rows when databinding Andy Fish Microsoft ASP .NET 1 31st Mar 2005 06:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:11 PM.