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

I have a data set that looks like this:

LA BEL: M_FRONT _HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.608 1808.8 1.5 -1.5 -0.192 **********


LA BEL: M_REAR_ HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.3624 1808.8 1.5 -1.5 -0.4376 **********


I want to delete all the rows except those that have Y: in the first column.
How would I do that? Everything I have tried so far has only deleted some
of the rows, but not all.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Deleting Rows

Set up an auto filter.
Select the whole Column where the Y appears, then from the main menu
Click on Data - Filter - Auto Filter
You will see a drop dow box appear in your column; click on it and find the
Y,this should select all of the rows that contain a Y. Then click on the rows
and hit delete, it will delete only the visible rows. The follow the same
procedure to remove the filter as you did to set it up.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"amboo_radley" wrote:

I have a data set that looks like this:

LA BEL: M_FRONT _HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.608 1808.8 1.5 -1.5 -0.192 **********


LA BEL: M_REAR_ HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.3624 1808.8 1.5 -1.5 -0.4376 **********


I want to delete all the rows except those that have Y: in the first column.
How would I do that? Everything I have tried so far has only deleted some
of the rows, but not all.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default Deleting Rows

Oops,
You should select Custom from the drop down the select Does not begin with Y
so you will leave all of the other rows you want to delete.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Michael" wrote:

Set up an auto filter.
Select the whole Column where the Y appears, then from the main menu
Click on Data - Filter - Auto Filter
You will see a drop dow box appear in your column; click on it and find the
Y,this should select all of the rows that contain a Y. Then click on the rows
and hit delete, it will delete only the visible rows. The follow the same
procedure to remove the filter as you did to set it up.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"amboo_radley" wrote:

I have a data set that looks like this:

LA BEL: M_FRONT _HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.608 1808.8 1.5 -1.5 -0.192 **********


LA BEL: M_REAR_ HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.3624 1808.8 1.5 -1.5 -0.4376 **********


I want to delete all the rows except those that have Y: in the first column.
How would I do that? Everything I have tried so far has only deleted some
of the rows, but not all.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Deleting Rows

This does not work on the blank rows.

"Michael" wrote:

Oops,
You should select Custom from the drop down the select Does not begin with Y
so you will leave all of the other rows you want to delete.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Michael" wrote:

Set up an auto filter.
Select the whole Column where the Y appears, then from the main menu
Click on Data - Filter - Auto Filter
You will see a drop dow box appear in your column; click on it and find the
Y,this should select all of the rows that contain a Y. Then click on the rows
and hit delete, it will delete only the visible rows. The follow the same
procedure to remove the filter as you did to set it up.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"amboo_radley" wrote:

I have a data set that looks like this:

LA BEL: M_FRONT _HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.608 1808.8 1.5 -1.5 -0.192 **********


LA BEL: M_REAR_ HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.3624 1808.8 1.5 -1.5 -0.4376 **********


I want to delete all the rows except those that have Y: in the first column.
How would I do that? Everything I have tried so far has only deleted some
of the rows, but not all.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Deleting Rows

Give this a try:
Sub Delete_with_Autofilter()
Dim DeleteValue As String
Dim rng As Range

With ActiveSheet
.Range("A1:A100").AutoFilter Field:=1, Criteria1:="<Y*"
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete

End With
.AutoFilterMode = False
End With
End Sub

Regards,
Ryan---

--
RyGuy


"Michael" wrote:

Oops,
You should select Custom from the drop down the select Does not begin with Y
so you will leave all of the other rows you want to delete.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Michael" wrote:

Set up an auto filter.
Select the whole Column where the Y appears, then from the main menu
Click on Data - Filter - Auto Filter
You will see a drop dow box appear in your column; click on it and find the
Y,this should select all of the rows that contain a Y. Then click on the rows
and hit delete, it will delete only the visible rows. The follow the same
procedure to remove the filter as you did to set it up.
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"amboo_radley" wrote:

I have a data set that looks like this:

LA BEL: M_FRONT _HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.608 1808.8 1.5 -1.5 -0.192 **********


LA BEL: M_REAR_ HEIGHT
Po ints Taken: 1
Actual Nominal #NAME? #NAME? Dev Out/Tol
Y: 1808.3624 1808.8 1.5 -1.5 -0.4376 **********


I want to delete all the rows except those that have Y: in the first column.
How would I do that? Everything I have tried so far has only deleted some
of the rows, but not all.

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
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Programming 2 November 13th 08 01:32 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Links and Linking in Excel 1 November 13th 08 08:44 AM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Setting up and Configuration of Excel 1 November 12th 08 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Worksheet Functions 1 November 12th 08 01:39 PM
Help!! I have problem deleting 2500 rows of filtered rows!!!! shirley_kee Excel Discussion (Misc queries) 1 January 12th 06 03:24 AM


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