• 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.

Help in Macro

Rahul Aggarwal

New Member
Hello Team,

please fin below for the example
A B c
1
2 1
3 2
4 3
5 4

I have button and i want when i enter any value at A1 (value already exist in B2:B5) and click on button. that value should be filter.
for example if i enter 3 in A1 and click on that button. value 3 should be filtered.

is it possible. ?
frown.png


your response is greatly appreciate

Regards,
Rahul
 
Rahul,

You could use formulas or an advanced Filter
Can you tell us more about what your trying to achieve?
 
In Addition to what Mr Hui said.
Try it.

Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = [A1] And Target <> "" Then Range("B1:B5").AutoFilter 1, Range("A1").Value
End Sub
 
Back
Top