Thomas,
If I understand correctly you want to read each cell in column AB excluding
the top header rows which are a fixed location and the bottom 4 rows which
are a blank row and 3 rows with data. You then want to delete the entire row
depending on what is in those cells. If this is correct try:-
Sub deleteit()
Dim myrange As Range
lastrowcolab = Range("AB65536").End(xlUp).Row - 4
Set myrange = Range("AB10:A" & lastrowcolab)
For Each c In myrange
c.Select
If c.Value = "Q" Then '<Change to your criteria
Selection.EntireRow.Delete
End If
Next
End Sub
Mike
"Tomas Stroem" wrote:
> Norman,
> There are three rows with different types of summaries at the bottom. Right
> now I have a blank row inserted before the summaries. This blank row is the
> first after the ones in the header rows that ever will appear at the time the
> macro will be run.
> --
> Tomas S
>
>
> "Norman Jones" wrote:
>
> > Hi Tomas,
> >
> > Are the 'summary fields' always found in the last data row?
> >
> >
> > ---
> > Regards,
> > Norman
> >
> >
> > "Tomas Stroem" <(E-Mail Removed)> wrote in message
> > news:75A821CD-920F-4941-B923-(E-Mail Removed)...
> > > Hi,
> > >
> > > I have a problem to get a macro that deletes rows in a worksheet depending
> > > on the value in row "AB". In the top of the sheet there are headers that i
> > > do
> > > not want to test for and at the bottom there are some summary fields that
> > > i
> > > do not want to test for either.
> > > The header are always in the same place but the summary fields can vary in
> > > position.
> > >
> > > Doe anyone have a good suggestion on how to solve this?
> > > --
> > > Tomas S
> >
> >
> >
|