![]() |
macro
I am very new at macros. I would to create one that would after sorting a
table delete automatically the whole row if a specific cell from that row contain a specific value. For example if I sort my table by column C: who is enrolled, waiting for enrolment, pass to centre, rejected by centre. I want then my macro to select all the "rejected by centre" and delete these rows. Is it possible? Many thanks |
macro
You can do this without sorting by a looping macro such as sub deletebadrows() for i=cells(rows.count,"a").end(xlup).row to 2 step -1 if ucase(cells(i,"c"))="REJECTED BY CENTRE" then rows(i).delete next i or if you sort and the bad rows are at the bottom use FIND and delete all rows below. Other ways. -- Don Guillett SalesAid Software "Pascale" wrote in message ... I am very new at macros. I would to create one that would after sorting a table delete automatically the whole row if a specific cell from that row contain a specific value. For example if I sort my table by column C: who is enrolled, waiting for enrolment, pass to centre, rejected by centre. I want then my macro to select all the "rejected by centre" and delete these rows. Is it possible? Many thanks |
macro
Sub delete_rows()
Dim c As Range With Columns("C") Do Set c = .Find("rejected by centre", LookIn:=xlValues, _ LookAt:=xlWhole, MatchCase:=False) If c Is Nothing Then Exit Do c.EntireRow.Delete Loop End With End Sub Gord Dibben MS Excel MVP On Mon, 12 Mar 2007 10:16:31 -0700, Pascale wrote: I am very new at macros. I would to create one that would after sorting a table delete automatically the whole row if a specific cell from that row contain a specific value. For example if I sort my table by column C: who is enrolled, waiting for enrolment, pass to centre, rejected by centre. I want then my macro to select all the "rejected by centre" and delete these rows. Is it possible? Many thanks |
All times are GMT +1. The time now is 12:32 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com