ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autofilter Question (https://www.excelbanter.com/excel-programming/404383-re-autofilter-question.html)

Qaspec

Autofilter Question
 
Thank you. THat was a great help. I had to modify it just a little bit so i
could avoid hiding rows in the auto filter i did not want to hide.

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Me.Range("A2")) Is Nothing Then

On Error Resume Next
Me.Columns(10).AutoFilter
On Error GoTo 0

Worksheets("Sheet1").Range("A14:C318").AutoFilter field:=3,
Criteria1:=Target.Value

End If

End Sub

"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Me.Range("A2")) Is Nothing Then

On Error Resume Next
Me.Columns(3).AutoFilter
On Error GoTo 0

Me.Columns(3).AutoFilter field:=1, Criteria1:=Target.Value
End If

End Sub



--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Qaspec" wrote in message
...
Can I use VBA to identify the value in a cell and update the autofilter
for a
specific column with that value?

When user types a name into A2 the the autofilter for column c updates to
filter for that name.






All times are GMT +1. The time now is 03:32 AM.

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