Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro for deleting rows and serialising the remaing rows | Excel Programming | |||
Macro for deleting rows and serialising the remaing rows | Links and Linking in Excel | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Help!! I have problem deleting 2500 rows of filtered rows!!!! | Excel Discussion (Misc queries) |