Filter in place question for sort of unique records

  • Thread starter Thread starter a
  • Start date Start date
A

a

Hello,

I know that this should be simple - but I'm not sure how to get the
results I want.

I want the unique record to be from one column - but if the data in the
next column is not unique - I still want it to only consider the
uniqueness of the first column.

For instance - if I want select only one vendor - but the column next to
the vendor has a different PO number, I don't want it to show me all the
records for the particular vendor - I only want it to show me the
information on the one vendor - without bringing along the instance of
the vendor when it has a different PO.

Any help would be appreciated. Following is a lame sample.

Sub Try()


Dim myVariable
myVariable = InputBox("Choose your contract", "contract", "Mentor")
Range("d2").Value = myVariable
Columns("A:A").Select
Range("A1:b7").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Range( _
"D1:D2"), CopyToRange:=Range("F1:g1"), Unique:=True
End Sub
 
OJ,

I'm not quite sure what you mean. The criteria range is a header - call
it vendor - and then the variable that the user selects - the default
being "Mentor". Is this what you mean?

Anita

Hi,
Post what is in your criteria range.

OJ






Hello,

I know that this should be simple - but I'm not sure how to get the
results I want.

I want the unique record to be from one column - but if the data in the
next column is not unique - I still want it to only consider the
uniqueness of the first column.

For instance - if I want select only one vendor - but the column next to
the vendor has a different PO number, I don't want it to show me all the
records for the particular vendor - I only want it to show me the
information on the one vendor - without bringing along the instance of
the vendor when it has a different PO.

Any help would be appreciated. Following is a lame sample.

Sub Try()


Dim myVariable
myVariable = InputBox("Choose your contract", "contract", "Mentor")
Range("d2").Value = myVariable
Columns("A:A").Select
Range("A1:b7").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=Range( _
"D1:D2"), CopyToRange:=Range("F1:g1"), Unique:=True
End Sub


OJ wrote:
 
Back
Top