Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default delete rows with header, excluding 1st row

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).

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default delete rows with header, excluding 1st row

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"
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
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
Countif excluding hidden rows qh8519a Excel Worksheet Functions 4 September 19th 08 06:22 PM
Excluding Hidden Rows from calculations Terry Bennett Excel Worksheet Functions 3 November 1st 07 01:28 AM
ListBox with header row, delete row, protect header row mikeolson Excel Programming 2 March 12th 07 02:59 AM
How do i split my column excluding the header into three sections Linzi Excel Discussion (Misc queries) 2 August 31st 06 12:18 AM
Excluding certain rows from Sort [email protected] Excel Programming 0 July 13th 06 09:28 PM


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