Hide rows with zero value in Multiple sheets
Solved/Closed
Related:
- Hide rows with zero value in Multiple sheets
- Google sheets download - Download - Spreadsheets
- Steam hide comments - Guide
- Potplayer hide controls - Guide
- Ip hide platinum - Download - VPN
- Quicktime hide controls - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
12 Apr 2010 à 09:31
12 Apr 2010 à 09:31
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
10 Jul 2013 à 13:49
Worked perfect......