#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default Seclec

Is there a code or a way to seclec row to delete with out spisifing the row
range or cell? Please see "<---" below. Thanks

Selection.AutoFilter Field:=9, Criteria1:="="
Range("A42861:I42861").Select <--- It would be for this range of rows
Range("I42861").Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
Range("I42861").Select
Selection.AutoFilter Field:=9
or
Selection.AutoFilter Field:=9, Criteria1:="="
Rows("2:2").Select <--- or for this range of rows
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter Field:=9
Range("A2").Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Seclec

Rows is a range object.
you can simply do:
rows("2:2").Delete Shift:=xlUp
or
rows(2).Delete Shift:=xlUp

you do not need to select it

"pgarcia" wrote:

Is there a code or a way to seclec row to delete with out spisifing the row
range or cell? Please see "<---" below. Thanks

Selection.AutoFilter Field:=9, Criteria1:="="
Range("A42861:I42861").Select <--- It would be for this range of rows
Range("I42861").Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
Range("I42861").Select
Selection.AutoFilter Field:=9
or
Selection.AutoFilter Field:=9, Criteria1:="="
Rows("2:2").Select <--- or for this range of rows
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter Field:=9
Range("A2").Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default Seclec

God, I didn't even test it. The 2nd code worked great, THANKS!

"barnabel" wrote:

Rows is a range object.
you can simply do:
rows("2:2").Delete Shift:=xlUp
or
rows(2).Delete Shift:=xlUp

you do not need to select it

"pgarcia" wrote:

Is there a code or a way to seclec row to delete with out spisifing the row
range or cell? Please see "<---" below. Thanks

Selection.AutoFilter Field:=9, Criteria1:="="
Range("A42861:I42861").Select <--- It would be for this range of rows
Range("I42861").Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Delete
Range("I42861").Select
Selection.AutoFilter Field:=9
or
Selection.AutoFilter Field:=9, Criteria1:="="
Rows("2:2").Select <--- or for this range of rows
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
Selection.AutoFilter Field:=9
Range("A2").Select

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



All times are GMT +1. The time now is 08:38 PM.

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"