ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to identify text from a autofiltered list using formulas (https://www.excelbanter.com/excel-worksheet-functions/99215-how-identify-text-autofiltered-list-using-formulas.html)

Harryac

How to identify text from a autofiltered list using formulas
 
I have a worksheet with 8 columns of information.
I am using the AutoFilter command to display only specific information from
the list.
Is there a way, using formulas, to extract information from only the
displayed data?

Ex: One of the columns being sorted contains state names, using the
Autofilter command, data for the state of New Jersey is displayed. Is there a
way, using formulas, to extract the state name from the displayed data so it
can be used in concatenating descriptions and used as a lookup criteria in
other formulas?

Thanks

Mallycat

How to identify text from a autofiltered list using formulas
 

You could create a custom function. This will get you started but it is
not perfect

Function FilterSelection(Column As Integer)

With Worksheets("sheet1")
If .AutoFilterMode Then
With .AutoFilter.Filters(Column)
If .On Then FilterSelection = .Criteria1
End With
End If
End With
FilterSelection = Right(FilterSelection, Len(FilterSelection) - 1)

End Function

You currently have to select which column the filter is in
=filterselection(2) for the second column. Also you have to specify
the sheet name in the function (not ideal). Finally when the pivot
table changes, the function doesn't refresh, but this could be
addressed with another macro

Matt


--
Mallycat
------------------------------------------------------------------------
Mallycat's Profile: http://www.excelforum.com/member.php...o&userid=35514
View this thread: http://www.excelforum.com/showthread...hreadid=561280



All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com