First, Thank you
Can you provide an example?
Eli
Eli, have a look at my demonstration of a pivot table (pictures are much easier to relate to).
http://ca.geocities.com/b_davidso/Web_Page_Files/Excel/pivottable1.html
Regards,
Barrie
try this (paste into a VBA window & use ALT+F8 to call
Sub unique_values()
'Creates a sorted list of unique values starting at Target
Dim Examine As String 'topmost cell in the range of values
Dim Target As String 'the topmost cell of the output
Dim ThisPrompt As String
ThisPrompt = "Where is the Label at the top of the values to test ?" _
& Chr(13) & Chr(13) & "Remember ;" & Chr(13) & Chr(13) & _
"It will reappear at the top of your unique values"
On Error GoTo Fail:
Examine = InputBox(ThisPrompt)
ThisPrompt = "Where is the Label to be put ?" _
& Chr(13) & Chr(13) & "Remember ;" & Chr(13) & Chr(13) & _
"You will need blank cells under the label" & _
Chr(13) & "and AAA is the same as aaa"
Target = InputBox(ThisPrompt)
Range(Target).Clear 'needed to stop filtering falling over
Range(Examine).Activate
'filter then insert unique values starting at Target
Range(Examine, ActiveCell.End(xlDown)).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
Target), Unique:=True
'now sort the values
Range(Target).Select 'musn't remove this line
Range(Target, ActiveCell.End(xlDown)).Select
Selection.Sort Key1:=Range(Target), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Fail:
End Sub