Macro to filter from Sheet6 Onwards Column B

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,589
Office Version
  1. 2021
Platform
  1. Windows
I would like to filter Col B on all sheets from sheet 6 onwards and to exclude zeroes in the filter


It would be appreciated if someone could kindly amend my code below


Code:
 Sub auto_filter_all_sheets() 
Dim ws As Worksheet 
Application.ScreenUpdating = False 

if selection.Rows.count < 3 then exit sub 
sAddress = Selection.Address 
For Each ws In ActiveWindow.SelectedSheets 
    ws.Range(sAddress).AutoFilter 
Next ws 
Application.ScreenUpdating = True 
End Sub
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Thanks for the reply


Kindly amend the code below so that I can filter the zeroes on all sheets from sheet6 onwards


Code:
 Sub filter_Zeroes

Dim c As Range, rng
 Set rng = Range("B1:B2000")
 For Each c In rng
 If c.Value = "0" Then
 c.EntireRow.Hidden = True
 End If
 Next c 
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top