#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 123
Default AUTOFILTER

Hi, I have an Excel worksheet and I am trying to find a way to delete
selected lines via VB, can any one help me please. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default AUTOFILTER

try pearsons page

http://www.cpearson.com/excel/deleting.htm

============
"BOSS" wrote in message
...
Hi, I have an Excel worksheet and I am trying to find a way to delete
selected lines via VB, can any one help me please. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default AUTOFILTER

there is another solution by David Hawley

Sub DeleteRowsBasedOnCriteria()
'Assumes the list has a heading.

With ActiveSheet
'If filters are not visible then turn them on
If .AutoFilterMode = False Then .Cells(1, 1).AutoFilter
'Set the filters in A1 to show only rows to delete
.AutoFilter Field:=1, Criteria1:="Delete"
'Delete all visible cells under the heading.
.Cells(1, 1).CurrentRegion.Offset(1, 0).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
'Remove filters
.AutoFilterMode = False
End With
End Sub
==================




"BOSS" wrote in message
...
Hi, I have an Excel worksheet and I am trying to find a way to delete
selected lines via VB, can any one help me please. Thanks



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
Applying an AutoFilter to a string Hardip Excel Discussion (Misc queries) 3 April 16th 06 05:32 PM
How to Sort within AutoFilter with Protection on (and AutoFilter . giblon Excel Discussion (Misc queries) 1 February 16th 06 12:23 PM
Autofilter not working correctly... Emily Excel Discussion (Misc queries) 0 January 11th 06 10:37 PM
Using AutoFilter with worksheet protection in 2000 vs. 2003 gncook Excel Discussion (Misc queries) 3 July 25th 05 08:02 PM
Strange Results with Autofilter Joyce Excel Discussion (Misc queries) 1 January 17th 05 02:42 AM


All times are GMT +1. The time now is 03:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"