Computing.Net > Forums > Office Software > Row delete macro

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Row delete macro

Reply to Message Icon

Name: suriya
Date: November 22, 2003 at 07:33:03 Pacific
OS: win98
CPU/Ram: 64
Comment:

hi

I need a macro for the following simple condition

I have A1 to B50000 of data with two coloumns

This data contains Whole numbers and also only the alphabet "a"
Now I need to delete all the rows, for which the value = "a"

How to do this with a macro?

suriya



Sponsored Link
Ads by Google

Response Number 1
Name: Bryco
Date: November 22, 2003 at 17:23:38 Pacific
Reply:

If I understand you correctly then you do not need a macro.
-A--B-
125-7
-a--12
62--a

Select the range of cells.
Go to Edit, Go to, Special
Select Constants and Text, (remove the other checks) Click OK.

The window will close and all of your cells containing the letter A will be highlighted.

Go to Edit, Delete and in the pop up box select Entire row and click OK.

Regards,
Bryan


0

Response Number 2
Name: Bryco
Date: November 22, 2003 at 17:46:39 Pacific
Reply:

The following will do the same but it is for Excel 97:

Sub DeleteText()
'
' DeleteText Macro
' Macro recorded 11/22/2003
'

'
Range("A1:B65000").Select
Selection.SpecialCells(xlCellTypeConstants, 2).Select
Selection.EntireRow.Delete
Range("A1").Select
End Sub

Bryan


0

Response Number 3
Name: Bryco
Date: November 22, 2003 at 17:50:00 Pacific
Reply:

I should clarify that this will delete any row that contains text in either column A or B regardless if it is the letter A or any other text.

Bryan


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: Row delete macro

Row delete macro www.computing.net/answers/office/row-delete-macro/1577.html

Help with rows delete macro www.computing.net/answers/office/help-with-rows-delete-macro/9503.html

Excel - Formula Based Row Deletion www.computing.net/answers/office/excel-formula-based-row-deletion/8553.html