Consulting

Results 1 to 2 of 2

Thread: Solved: Filter code help

  1. #1
    VBAX Tutor
    Joined
    Feb 2008
    Location
    New York
    Posts
    215
    Location

    Solved: Filter code help

    Hello all,

    I need help with following Code.

    Private Sub CommandButton6_Click()
    Application.ScreenUpdating = False
    Sheets("AuditIssues").Select
    If ActiveSheet.FilterMode = True Then
    ActiveSheet.ShowAllData
    Selection.AutoFilter Field:=8, Criteria1:="Active"
    Selection.AutoFilter Field:=9, Criteria1:="Peter"
    Application.ScreenUpdating = True
    End Sub

    By clicking the button, the sheet named "AuditIssues" should open, unfilter all the table and select "Active" and "Peter" from columns H and I. Can someone please help? Thanks.
    -u

  2. #2
    VBAX Tutor
    Joined
    Feb 2008
    Location
    New York
    Posts
    215
    Location
    Actually the folowing worked. Thanks.

    Private Sub CommandButton6_Click()
    Application.ScreenUpdating = False
    Sheets("AuditIssues").Select
    If ActiveSheet.FilterMode = True Then
    ActiveSheet.ShowAllData
    End if
    Selection.AutoFilter Field:=8, Criteria1:="Active"
    Selection.AutoFilter Field:=9, Criteria1:="Peter"
    Application.ScreenUpdating = True
    End Sub
    -u

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •