Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
using a cell value to control a counter inside a macro and displaying macro value | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |