so a user can easy get to records in the file without using the excel filter function....making it super easy for anyone to use.
can anyone help?
Tony
so a user can easy get to records in the file without using the excel filter function....making it super easy for anyone to use.
can anyone help?
Tony
Tony,
Welcome to the forum!
Attached is an example workbook based on the criteria you described.
In cell B1 is a drop-down list of the column headers so you can choose which column you're filtering by.
In cell B2 you can type in what you want to filter for.
Changing either of those cells will trigger the worksheet_change event:
![]()
Private Sub Worksheet_Change(ByVal Target As Range) Dim rngCol As Range Dim rngKey As Range Dim lCalc As Long Dim rngFilter As Range Dim LastRow As Long Set rngCol = Me.Range("B1") Set rngKey = Me.Range("B2") If Target.Address = rngCol.Address _ Or Target.Address = rngKey.Address Then Me.AutoFilterMode = False If Len(rngCol.Value) = 0 Or Len(rngKey.Value) = 0 Then Exit Sub With Application lCalc = .Calculation .Calculation = xlCalculationManual .EnableEvents = False .ScreenUpdating = False End With On Error GoTo CleanExit LastRow = Me.Cells.Find("*", Me.Range("A1"), , , , xlPrevious).Row Set rngFilter = Me.Range("A4:E4").Find(rngCol.Value, , , xlWhole) Set rngFilter = Range(rngFilter, Me.Cells(LastRow, rngFilter.Column)) rngFilter.AutoFilter 1, rngKey.Text CleanExit: With Application .Calculation = lCalc .EnableEvents = True .ScreenUpdating = True End With End If End Sub
Is something like that what you're looking for?
Last edited by tigeravatar; 05-18-2012 at 03:12 PM. Reason: Had to reupload attachment
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
yeah thats even more than I need...only need the function on B2 to scan two columns and filter on the text inputed.
thanks so much...
Tony
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks