Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete rows using a macro
Hello,
I need help with a macro that will delete certain rows in a spreadsheet. The rows that need to be deleted are never in the same place, or the same number of rows. The thing that the rows I want to delete all have in common a specific word say "YES" in the same column. But they are never in the same place everytime. Please suggest me on this. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete rows using a macro
Here is a typical example. The macro deletes any rows with "YES" in column B:
Sub YESMan() n = Cells(Rows.Count, "B").End(xlUp).Row For i = n To 1 Step -1 If Cells(i, "B").Value = "YES" Then Cells(i, "B").EntireRow.Delete End If Next End Sub -- Gary''s Student - gsnu200855 "Sasikiran" wrote: Hello, I need help with a macro that will delete certain rows in a spreadsheet. The rows that need to be deleted are never in the same place, or the same number of rows. The thing that the rows I want to delete all have in common a specific word say "YES" in the same column. But they are never in the same place everytime. Please suggest me on this. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete rows using a macro
Thanks a ton :)
"Gary''s Student" wrote: Here is a typical example. The macro deletes any rows with "YES" in column B: Sub YESMan() n = Cells(Rows.Count, "B").End(xlUp).Row For i = n To 1 Step -1 If Cells(i, "B").Value = "YES" Then Cells(i, "B").EntireRow.Delete End If Next End Sub -- Gary''s Student - gsnu200855 "Sasikiran" wrote: Hello, I need help with a macro that will delete certain rows in a spreadsheet. The rows that need to be deleted are never in the same place, or the same number of rows. The thing that the rows I want to delete all have in common a specific word say "YES" in the same column. But they are never in the same place everytime. Please suggest me on this. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to delete rows | Excel Discussion (Misc queries) | |||
Need a macro to delete rows | Excel Discussion (Misc queries) | |||
Delete all Rows Macro | Excel Discussion (Misc queries) | |||
Macro to Delete Certain Rows | Excel Discussion (Misc queries) | |||
delete rows-macro | Excel Discussion (Misc queries) |