+ Reply to Thread
Results 1 to 2 of 2

Intense Filtering Issues...

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    3

    Intense Filtering Issues...

    My file has a set of 7 buttons that unhide/hide specific columns (R:X). Initially rows R:X are hidden. Clicking the toggle button 1 will unhide columns R (unclicking hides it). You can unhide/hide any combination of these seven rows.

    I am trying to make it so that if you click one of the toggle buttons, the column is unhidden AND only the rows with entries (not blank) are shown. I have created 7 separate hidden columns (J:K) that call to the original 7 columns. If a cell in the column is not blank. then J:K return "Filled" (i.e. if cell R22 has a "P" in it, then J22 returns "Filled")

    I currently have the code for the toggle buttons to unhide the given column in R:X and then filter the corresponding column for "Filled." This displays only the rows in that column that have entries.

    The problem I am running into is if you select more than one Toggle Button (which is usually the case). I want all the rows to be displayed that have entries in any of the unhidden columns (i.e. if R22 is blank but S22 is filled, then row 22 should be displayed, and if R23 is filled but S23 is blank, then row 23 should be displayed).

    If you click more than one toggle button, the data is refreshed and the column is filtered for "Fitted", but the buttons that are already selected lose there filter.

    Is there any way to make it so that all the activities that have a "Fitted" for one of the displayed columns are displayed?

    Here is the code for the first 3 toggle buttons (the next 4 are the same...)

    rivate Sub ToggleButton1_Click()
    'This is the PQM button
    If ToggleButton1.Value = True Then
    Columns("R:R").EntireColumn.Hidden = False
    Selection.AutoFilter Field:=1, Criteria1:="<>"
    ActiveSheet.ShowAllData
    Selection.AutoFilter Field:=8, Criteria1:="Filled"
    Else
    Columns("R:R").EntireColumn.Hidden = True
    Selection.AutoFilter Field:=1, Criteria1:="<>"
    ActiveSheet.ShowAllData
    End If
    End Sub
    Private Sub ToggleButton2_Click()
    'This is the QAC button
    If ToggleButton2.Value = True Then
    Columns("S:S").EntireColumn.Hidden = False
    Selection.AutoFilter Field:=1, Criteria1:="<>"
    ActiveSheet.ShowAllData
    Selection.AutoFilter Field:=9, Criteria1:="Filled"
    Else
    Columns("S:S").EntireColumn.Hidden = True
    Selection.AutoFilter Field:=1, Criteria1:="<>"
    ActiveSheet.ShowAllData
    End If
    End Sub
    Private Sub ToggleButton3_Click()
    'This is the PQC button
    If ToggleButton3.Value = True Then
    Columns("T:T").EntireColumn.Hidden = False
    Selection.AutoFilter Field:=1, Criteria1:="<>"
    ActiveSheet.ShowAllData
    Selection.AutoFilter Field:=10, Criteria1:="Filled"
    Else
    Columns("T:T").EntireColumn.Hidden = True
    Selection.AutoFilter Field:=1, Criteria1:="<>"
    ActiveSheet.ShowAllData
    End If
    End Sub

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Intense Filtering Issues...

    Please take a few minutes to reread the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1