If you have col f with
f1
f2
f3
f4
f5 10
f6 4
f7 5
f8 10
f9 6
f10 10
and you want to delete row 8 and row 10, then this will do it
for i = 10 to 6 step -1
if cells(i,"f")=cells(5,"f") then rows(i).delete
next i
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Sue" <(E-Mail Removed)> wrote in message
news:1E2804B2-AC9F-45B9-8415-(E-Mail Removed)...
> Hi
>
> My mistake
>
> I should have stipulated the used range
>
> and in Column F / Row 5 there is a number and if any cell in the used
> range
> in Column F does not match that number then the row is deleted
> --
> Many Thanks
>
> Sue
>
>
> "Barb Reinhardt" wrote:
>
>> All the cells in Row F? Do you mean all 256 in Excel 2003 and who
>> knows
>> how many in 2007? Or are you just talking about the cells in the
>> UsedRange?
>>
>> Barb Reinhardt
>>
>> "Sue" wrote:
>>
>> > Hi All
>> >
>> > An easy one for all you experts
>> >
>> > I need a macro to delete the all the rows on the active sheet if in
>> > Column F
>> > / Row5 the values in all the cells in Column F do not match the value
>> > in
>> > Column F / Row5
>> > --
>> > Many Thanks
>> >
>> > Sue