Thread: macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default 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