Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to Delete row with criteria ?


Hi everyone.

I have a col that contains many other value such as:
A1 contain 0
A2 - 544
A3 -0
A4 - 100
A5 -0
A6 -53
A7 -0
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default How to Delete row with criteria ?

Starting with code I found here
http://www.angelfire.com/biz7/julian...ans_macros.htm
First select the cells in the column

Sub DelRowIfCriteria()
Dim rng As Integer
Dim i As Integer

Dim cellCriteria As Integer

cellCriteria = InputBox(prompt:="Enter criteria.")

rng = Selection.Rows.Count
ActiveCell.Offset(0, 0).Select
Application.ScreenUpdating = False
For i = 1 To rng
If ActiveCell.Value = cellCriteria Then
Selection.EntireRow.Delete
Else
ActiveCell.Offset(1, 0).Select
End If
Next i
Application.ScreenUpdating = True
End Sub

vumian wrote:
Hi everyone.

I have a col that contains many other value such as:
A1 contain 0
A2 - 544
A3 -0
A4 - 100
A5 -0
A6 -53
A7 -0


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200607/1
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
VLookup with criteria and delete row capt Excel Discussion (Misc queries) 5 January 26th 08 09:29 PM
Delete row if column criteria was met EKB Excel Programming 1 May 7th 06 09:11 AM
Further help on delete criteria found rjamison Excel Programming 0 June 14th 05 12:14 AM
How do I delete a row from a spreadsheet if criteria is not met i. wonderboy55 Excel Worksheet Functions 1 April 26th 05 03:43 PM
delete rows with criteria S.E. Excel Programming 5 September 9th 04 04:04 PM


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