Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Deleting filtered data

Hi, I have a macro which filters data and deletes using the code below.

Cells.Select

With Selection
.AutoFilter Field:=30, Criteria1:="1"

Selection.EntireRow.Delete Shift:=xlUp
End With
Unfortuantely this deletes the header row as well. Does anyone know how to
avoid this happening?

Any help greatly appreciated.

cheers,

Davie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Deleting filtered data

See this example
http://www.rondebruin.nl/delete.htm#AutoFilter


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"davethewelder" wrote in message
...
Hi, I have a macro which filters data and deletes using the code below.

Cells.Select

With Selection
.AutoFilter Field:=30, Criteria1:="1"

Selection.EntireRow.Delete Shift:=xlUp
End With
Unfortuantely this deletes the header row as well. Does anyone know how to
avoid this happening?

Any help greatly appreciated.

cheers,

Davie


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Deleting filtered data

Ron, thanks for the quick reply. The example worked perfectly.

I posted a problem on the site three days ago but unfortunately no-one has
picked it up and I am running out of time to complete this report. Could you
possibly have a look at it. It is called "Formatting cell and adjacent cell".

If you can't, thanks anyway.

Davie

"Ron de Bruin" wrote:

See this example
http://www.rondebruin.nl/delete.htm#AutoFilter


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"davethewelder" wrote in message
...
Hi, I have a macro which filters data and deletes using the code below.

Cells.Select

With Selection
.AutoFilter Field:=30, Criteria1:="1"

Selection.EntireRow.Delete Shift:=xlUp
End With
Unfortuantely this deletes the header row as well. Does anyone know how to
avoid this happening?

Any help greatly appreciated.

cheers,

Davie



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
MS2007 - deleting filtered data, deletes non-visible data too Nita Excel Discussion (Misc queries) 1 December 9th 08 03:42 PM
Deleting filtered results Dennis Excel Discussion (Misc queries) 4 January 28th 08 07:01 PM
Saving Auto-Filtered Data (or deleting the rest) CH53 Excel Discussion (Misc queries) 3 December 11th 07 01:07 AM
Deleting filtered rows in Excel RajeevAsthana Excel Discussion (Misc queries) 1 December 5th 07 03:20 PM
Deleting filtered out data from a worksheet Sierras Excel Worksheet Functions 2 January 20th 06 09:27 PM


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