Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2007

Tip: Looking for answers? Try searching our database.

delete cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lijia137@gmail.com - 13 Dec 2007 16:00 GMT
i have a worksheet with several columns, and i want to use one
specific colume as my reference, i.e. values under 100 in this column
as well as values/texts in the same rows should be deleted, basically
it's to delete a range of data based on certail value, is there a
way?
thanks a ton!
JLGWhiz - 13 Dec 2007 16:20 GMT
Assume the data is in column A.

Sub dltunder100()
 Dim c As Range
 lastRow = Cells(Rows.Count, 1).End(xlUp).Row
 For Each c In Range("A1:A" & lastRow)
    If c.Value < 100 Then
      c.EntireRow.Delete   'can be changed to a specific range
    End If
 Next
End Sub

> i have a worksheet with several columns, and i want to use one
> specific colume as my reference, i.e. values under 100 in this column
> as well as values/texts in the same rows should be deleted, basically
> it's to delete a range of data based on certail value, is there a
> way?
> thanks a ton!
JLGWhiz - 13 Dec 2007 16:21 GMT
One posting will usually do it.  See your first one.

> i have a worksheet with several columns, and i want to use one
> specific colume as my reference, i.e. values under 100 in this column
> as well as values/texts in the same rows should be deleted, basically
> it's to delete a range of data based on certail value, is there a
> way?
> thanks a ton!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.