Hide rows with zero value in Multiple sheets
Solved/Closed
Related:
- Hide rows with zero value in Multiple sheets
- Google sheets right to left - Guide
- Steam hide comments - Guide
- Platinum hide ip - Download - VPN
- Potplayer hide controls - Guide
- Quicktime hide controls - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Apr 12, 2010 at 09:31 AM
Apr 12, 2010 at 09:31 AM
Objective:
To filter /hide the rows on all sheet for a given value.
Assumptions:
1. The location of the column is same on every sheet
3. Filter needs to be applied on all sheets
3. Sheets are not hidden
4. All Sheets have at least one cell filled
STEPS
1. Read the assumptions
2. Make a back up copy
3. Press ALT + F11 and insert a new module
4. Paste the code and run it
CODE:
To filter /hide the rows on all sheet for a given value.
Assumptions:
1. The location of the column is same on every sheet
3. Filter needs to be applied on all sheets
3. Sheets are not hidden
4. All Sheets have at least one cell filled
STEPS
1. Read the assumptions
2. Make a back up copy
3. Press ALT + F11 and insert a new module
4. Paste the code and run it
CODE:
Sub HideRows()
Dim Sheet As Object
Dim filterFor As Variant
Dim iFilterCol As Integer
iFilterCol = 3 'apply filter on 3 col
filterFor = InputBox("Enter the value to be filtered out", "Filter out")
For Each Sheet In Sheets
Sheet.Select
If ActiveSheet.AutoFilterMode Then
Cells.Select
Selection.AutoFilter
End If
Cells.Select
If ActiveSheet.AutoFilterMode = False Then
Selection.AutoFilter
End If
Selection.AutoFilter Field:=iFilterCol, Criteria1:="<>" & filterFor, Operator:=xlAnd
Next
End Sub
Jul 10, 2013 at 01:49 PM
Worked perfect......