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.

deleting cells

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lijia137@gmail.com - 13 Dec 2007 16:08 GMT
I have a workbook that i need to delete some cells automatically after
sorting. The rule is to use one specific column (say column O) as
reference, i.e. values<100 in this column, together with things in the
same rows should be deleted, basically it's to delete a range of data?
how should i write it? Thanks a ton!
Nigel - 13 Dec 2007 16:37 GMT
One way.... Scan the entire rows to perform test from bottom to top.,
testing each column value and deleting entire row.  Something like

Sub RemRows()
Dim xr As Long
With ActiveSheet
For xr = 100 To 1 Step -1
  If .Cells(xr, "O") < 100 Then Rows(xr).EntireRow.Delete
Next xr
End With

End Sub

Signature

Regards,
Nigel
nigelnospam@9sw.co.uk

>I have a workbook that i need to delete some cells automatically after
> sorting. The rule is to use one specific column (say column O) as
> reference, i.e. values<100 in this column, together with things in the
> same rows should be deleted, basically it's to delete a range of data?
> how should i write it? 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.