How to filter out #N/A Column BC in VBA

Tardisgx

Board Regular
Joined
May 10, 2018
Messages
81
[FONT=&quot]The columns relevant here are BA,BB&BC although I may put this data on a separate sheet just in A, B & C

The number of cells occupied and contents in BC changes. Which is why I can't press record and be happy.

[/FONT]

[FONT=&quot]On Columns BA,BB&BC data filter is applied.
[/FONT]

[FONT=&quot]I click the header drop down in BC and untick #/NA[/FONT]
[FONT=&quot]That's what I want to do in VBA. I messed up my attempts royally.[/FONT]
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hello Tardisgx,

This will work for column "BA:BC". You can change it to whichever column you want to filter. This assumes these three columns are separated from AZ and BD.

Code:
Sub FilterWithoutNA()


    Dim Rng As Range
    
        ActiveSheet.AutoFilterMode = False
            
        Set Rng = Wks.Range("BA1:BC1").CurrentRegion
            Rng.AutoFilter Field:=3, Criteria1:="<>#N/A", VisibleDropDown:=True
        
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,787
Messages
6,121,565
Members
449,038
Latest member
Guest1337

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