From: Rex on
I have a spreadsheet with 26 columns of info that's approx. 1000 rows long.
I need to sort by column L and then Column I. When done sorting I will have
multiple names (different every report) in column L and multiple medical
conditions (different every time) in column I. The goal is to keep one row
of each name matched with one entry of each medical condition (sorted for
that name) and hide all the other rows.

Daffy Duck may have 15 entries with a broken elbow and 13 entries with the
flu. I only want one row of each condition associated with Daffy Duck to
appear (it doesn't matter which row) and the rest of the rows would be
hidden. This would continue thru all the names and conditions. Anyone have
any macro suggestions? I use Excel 2003.

--
Rex Munn
From: Javed on
On Apr 29, 12:34 am, Rex <R...(a)discussions.microsoft.com> wrote:
> I have a spreadsheet with 26 columns of info that’s approx. 1000 rows long.  
> I need to sort by column L and then Column I.  When done sorting I will have
> multiple names (different every report) in column L and multiple medical
> conditions (different every time) in column I.  The goal is to keep one row
> of each name matched with one entry of each medical condition (sorted for
> that name) and hide all the other rows.  
>
> Daffy Duck may have 15 entries with a broken elbow and 13 entries with the
> flu.  I only want one row of each condition associated with Daffy Duck to
> appear (it doesn't matter which row) and the rest of the rows would be
> hidden.  This would continue thru all the names and conditions.  Anyone have
> any macro suggestions?  I use Excel 2003.
>
> --
> Rex Munn

Best is to use pivottable.which will sort and return the unique.
From: PY & Associates on
On Apr 29, 11:56 am, Javed <asadullaja...(a)gmail.com> wrote:
> On Apr 29, 12:34 am, Rex <R...(a)discussions.microsoft.com> wrote:
>
> > I have a spreadsheet with 26 columns of info that’s approx. 1000 rows long.  
> > I need to sort by column L and then Column I.  When done sorting I will have
> > multiple names (different every report) in column L and multiple medical
> > conditions (different every time) in column I.  The goal is to keep one row
> > of each name matched with one entry of each medical condition (sorted for
> > that name) and hide all the other rows.  
>
> > Daffy Duck may have 15 entries with a broken elbow and 13 entries with the
> > flu.  I only want one row of each condition associated with Daffy Duck to
> > appear (it doesn't matter which row) and the rest of the rows would be
> > hidden.  This would continue thru all the names and conditions.  Anyone have
> > any macro suggestions?  I use Excel 2003.
>
> > --
> > Rex Munn
>
> Best is to use pivottable.which will sort and return the unique.

something like this

Option Explicit

Sub m()
Dim c As Range
Dim rng As Range
Set rng = Range("I1:I1000")
For Each c In rng
If c = c.Offset(1) And c.Offset(, 4) = c.Offset(1, 4) Then c.RowHeight
= 0
Next c
End Sub
From: Rex on
That worked perfectly.
Thanks for your help.
--
Rex Munn


"PY & Associates" wrote:

> On Apr 29, 11:56 am, Javed <asadullaja...(a)gmail.com> wrote:
> > On Apr 29, 12:34 am, Rex <R...(a)discussions.microsoft.com> wrote:
> >
> > > I have a spreadsheet with 26 columns of info that's approx. 1000 rows long.
> > > I need to sort by column L and then Column I. When done sorting I will have
> > > multiple names (different every report) in column L and multiple medical
> > > conditions (different every time) in column I. The goal is to keep one row
> > > of each name matched with one entry of each medical condition (sorted for
> > > that name) and hide all the other rows.
> >
> > > Daffy Duck may have 15 entries with a broken elbow and 13 entries with the
> > > flu. I only want one row of each condition associated with Daffy Duck to
> > > appear (it doesn't matter which row) and the rest of the rows would be
> > > hidden. This would continue thru all the names and conditions. Anyone have
> > > any macro suggestions? I use Excel 2003.
> >
> > > --
> > > Rex Munn
> >
> > Best is to use pivottable.which will sort and return the unique.
>
> something like this
>
> Option Explicit
>
> Sub m()
> Dim c As Range
> Dim rng As Range
> Set rng = Range("I1:I1000")
> For Each c In rng
> If c = c.Offset(1) And c.Offset(, 4) = c.Offset(1, 4) Then c.RowHeight
> = 0
> Next c
> End Sub
> .
>