PC Review


Reply
Thread Tools Rate Thread

Deleting filtered data

 
 
davethewelder
Guest
Posts: n/a
 
      14th Apr 2008
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 With Quote
 
 
 
 
Ron de Bruin
Guest
Posts: n/a
 
      14th Apr 2008
See this example
http://www.rondebruin.nl/delete.htm#AutoFilter


--

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


"davethewelder" <(E-Mail Removed)> wrote in message
news:7C7D801A-488A-4CEB-B5F2-(E-Mail Removed)...
> 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 With Quote
 
davethewelder
Guest
Posts: n/a
 
      14th Apr 2008
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" <(E-Mail Removed)> wrote in message
> news:7C7D801A-488A-4CEB-B5F2-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
tried deleting filtered data - but all data gets deleted New user Microsoft Excel Crashes 1 18th Dec 2009 02:34 PM
Return filtered values into report worksheet based on filtered valueon the data worksheet dicko1 Microsoft Excel Worksheet Functions 1 21st Apr 2009 12:27 AM
MS2007 - deleting filtered data, deletes non-visible data too Nita Microsoft Excel Misc 1 9th Dec 2008 03:42 PM
Saving Auto-Filtered Data (or deleting the rest) CH53 Microsoft Excel Misc 3 11th Dec 2007 01:07 AM
Deleting filtered out data from a worksheet Sierras Microsoft Excel Worksheet Functions 2 20th Jan 2006 09:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:08 AM.