Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default Macro that deletes rows from cell containing End to end of data.

MS OS XP:
Excel 2000:

Need a macro that deletes all rows from the end of data up to a cell in
Colum A that contains the word End.

Example: If cell A(150) = €œEnd€ Then
Delete all rows from the end of data up to and including row 150.

Thanks in advanced,

--
Richard
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 53
Default Macro that deletes rows from cell containing End to end of data.

Sub DeleteRowsAfterWordEnd()

Dim iRow As Long
Dim iCol As Long

iRow = 1
iCol = 1

While Cells(iRow, iCol) < "End"
iRow = iRow + 1
If iRow 65536 Then
Exit Sub
End If
Wend

Rows(Format(iRow, "0") & ":65536").Delete

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Macro that deletes rows from cell containing End to end of data.

try this simple ditty
sub delrows()
fr=columns(1).find("End").row
lr=cells(rows.count,"a").end(xlup).row
rows(fr & ":" & lr).delete
end sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Richard" wrote in message
...
MS OS XP:
Excel 2000:

Need a macro that deletes all rows from the end of data up to a cell in
Colum A that contains the word End.

Example: If cell A(150) = €œEnd€ Then
Delete all rows from the end of data up to and including row 150.

Thanks in advanced,

--
Richard


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
shared file adds or deletes rows woodman Excel Discussion (Misc queries) 0 May 31st 07 04:46 PM
Macro that deletes every third row....+ ajjag Excel Discussion (Misc queries) 4 June 27th 06 06:03 PM
Copy to in Adv filter deletes data in lower rows Hari Excel Discussion (Misc queries) 0 May 30th 06 10:20 AM
Renaming and saving workbooks but macro still deletes shrek Excel Worksheet Functions 0 November 8th 05 05:43 PM
WHEN DOWNLOADING A TEXTFILE EXCEL DELETES BLANK ROWS - STOP THIS? shell3 Excel Worksheet Functions 0 October 21st 05 03:29 PM


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