Macro to filter from Sheet6 Onwards Column B

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,595
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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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