• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Filter according to a number that is in a range

Visor

Member
Greetings forum friends, I would like to help me make a filter.
I want the number that I put in the range A6 a macro to filter it and show me the row that corresponds only to that number below line 7 (note: the row number is not the same as the number that I put in A6)

I try to put a macro called macro1 to try with the magnifying glass, but it does not work as I want

I add file
 

Attachments

  • Control de Notas 2P A.xlsm
    264.5 KB · Views: 2
You were very close, filtering line needed to look like this
Code:
ActiveSheet.Range("$A$8:$A$77").AutoFilter Field:=1, Criteria1:=Range("A6").Value

If you want to make it automatic, in the sheet module, the event code would be:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rngInterest As Range
   
    'What range do you want to monitor?
   
    Set rngInterest = Range("A6")
   
    If Intersect(Target, rngInterest) Is Nothing Then Exit Sub
   
    'If blank, show everything. Otherwise, filter for value
   
    If rngInterest.Value = "" Then
        Me.AutoFilterMode = False
    Else
        Me.Range("$A$8:$A$77").AutoFilter Field:=1, Criteria1:=Range("A6").Value
    End If
   
End Sub
 
Gracias
Es justo como quería
Tema solucionado

Thank you
It's just as you wanted
issue solved
 
Back
Top