Re: Autofilter Question
- From: Gord Dibben <gorddibbATshawDOTca>
- Date: Mon, 14 Jan 2008 14:04:59 -0800
Sub Filter_Stuff()
Dim what As String
Dim collett As Integer
collett = 3 'could use an inputbox to enter column number
what = Range("A2").Value
With Active***.UsedRange
Selection.AutoFilter
Selection.AutoFilter Field:=collett, _
Criteria1:=what, Operator:=xlAnd
End With
End Sub
You could also call this from event code in the work***.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo stoppit
Application.EnableEvents = False
With Me.Range("A2")
If .Value <> "" Then
Call Filter_Stuff
End If
End With
stoppit:
Application.EnableEvents = True
End Sub
Gord Dibben MS Excel MVP
On Mon, 14 Jan 2008 12:41:05 -0800, Qaspec <Qaspec@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
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.
.
- Prev by Date: Re: comandbutton 2 select multipage
- Next by Date: Re: Autofilter Question
- Previous by thread: Re: comandbutton 2 select multipage
- Next by thread: Re: Autofilter Question
- Index(es):