Thread: Filter sub
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Pasty Pasty is offline
external usenet poster
 
Posts: 95
Default Filter sub

This is along the lines but seems to look in both columns rather than one
followed by the other so brings up nothing when filtered.

" wrote:

Hi
Just add another Filter. I'd also suggest starting by turning off
AutoFilter just incase it has been left on by a previous user.
regards
Paul
Sub FilterRiskOwner()

strRiskOwner = InputBox("Please enter your full name")
If strRiskOwner = "" Then
Exit Sub
End If
With Sheets("Risk By Function")
.select
.AutoFilterMode = False 'Removes drop down arrows
.AutoFilter Field:=3, Criteria1:=strRiskOwner
.AutoFilter Field:=4, Criteria1:=NextOne
End With
End Sub

With FixedHeadingsRange.Parent
On Error Resume Next 'required if Advanced filter used
.ShowAllData
On Error GoTo 0
.AutoFilterMode = False 'Removes drop down arrows
End With
Case 2
SurnamesRange.Offset(0, 2).AutoFilter Field:=1,
Criteria1:=CStr(Grouplistdata(1)), Operator:=xlOr,
Criteria2:=CStr(Grouplistdata(2))

On Mar 7, 9:55 am, Pasty wrote:
I am using this code to automatically filter for the information they are
after when they go in to my risk register and it works. Problem is it may be
a secondary person who is updating the register and I need to make it filter
the column next to it as well. Is there an easy way to do this?

Sub FilterRiskOwner()

strRiskOwner = InputBox("Please enter your full name")
If strRiskOwner = "" Then
Exit Sub
End If

Sheets("Risk By Function").Select
Range("A1").AutoFilter Field:=3, Criteria1:=strRiskOwner

End Sub