Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MWS MWS is offline
external usenet poster
 
Posts: 53
Default Deleting Unique Rows

Hello, I have the following code to delete blank rows within a worksheet.

'Deletes blank lines, for advance filterring
[a1:a50000].SpecialCells(xlCellTypeBlanks).EntireRow.Delete

Question: Is there a method to delete certain rows, if a particular cell
within a row meets certain criteria? For instance, I'd like to reference
range a1:a50000, and delete each row within this range, if "Sub Total" is the
value in any cell within column A.

Is this possible and if so, how?

Any and All Help Is Appreciated - Thank You
  #2   Report Post  
Posted to microsoft.public.excel.programming
ale ale is offline
external usenet poster
 
Posts: 14
Default Deleting Unique Rows

You could do a loop like this...

application.screenupdating=false
dim cell as range

for each cell in range("a1:a50000")
if cell.text="Sub Total" then cell.entirerow.delete
next cell

Of course faster ways can be used.

"MWS" wrote:

Hello, I have the following code to delete blank rows within a worksheet.

'Deletes blank lines, for advance filterring
[a1:a50000].SpecialCells(xlCellTypeBlanks).EntireRow.Delete

Question: Is there a method to delete certain rows, if a particular cell
within a row meets certain criteria? For instance, I'd like to reference
range a1:a50000, and delete each row within this range, if "Sub Total" is the
value in any cell within column A.

Is this possible and if so, how?

Any and All Help Is Appreciated - Thank You

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
Deleting Unique Values RK Excel Discussion (Misc queries) 2 March 17th 10 12:15 PM
Deleting Unique Rows MWS Excel Discussion (Misc queries) 1 March 21st 06 09:37 PM
Help!! I have problem deleting 2500 rows of filtered rows!!!! shirley_kee Excel Discussion (Misc queries) 1 January 12th 06 03:24 AM
Deleting Duplicates, All records unique mirdonamy Excel Discussion (Misc queries) 7 January 11th 06 09:59 PM
Duplicates - deleting to get just unique ones koncept New Users to Excel 3 August 24th 05 06:41 PM


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